Skip to main content

FieldLabel

Displays a label for an input field with an optional info icon. Hovering over the info icon reveals a tooltip containing additional context or guidance about the field. Use FieldLabel to provide clear, consistent labels and supplementary information without cluttering the interface.

Base
Custom component
Mantine
None — built here
Import
{ FieldLabel } from '@multiconsult-group-products/design-system'
Source
src/components/FieldLabel/FieldLabel.tsx
src/components/FieldLabel/FieldLabel.module.css

Usage​

React
<TextInput
label={<FieldLabel tooltip="Organisasjonsnummer, 9 siffer.">Org.nr</FieldLabel>}
placeholder="123 456 789"
/>

Props​

PropertyTypeAllowed valuesDefaultDescription
children*ReactNode——The label text.
tooltipstring——Explanation shown in the tooltip. The info icon is rendered only when this is set.
iconLabelstring—'Mer informasjon'Accessible name of the info icon button. Override it to name the field it belongs to, e.g. "Mer informasjon om organisasjonsnummer".

* Required

Accessibility​

The info icon is a button. Its tooltip opens on hover, keyboard focus and touch, and clicking it does not move focus into the labelled input.

Give iconLabel a field-specific value when a page has more than one FieldLabel with a tooltip. For the rest, see Accessibility.