Components
Label
Label functions as a clear and accessible text label that tells the user what an associated form element is about.
React
Press Enter to start editing
const Preview = () => { return <Label>Fødselsnummer (11 sifre)</Label>; }; render(<Preview />)
- weight
- Description
Adjusts font weight. Use this when you have a label hierarchy, such as checkboxes/radios in a fieldset
- Type
"regular" | "medium" | "semibold"- Default
medium
- asChild
- Description
Change the default rendered element for the one passed as a child, merging their props and behavior.
- Type
boolean- Default
false
| Name | Type | Default | Description |
|---|---|---|---|
| weight | "regular" | "medium" | "semibold" | medium | Adjusts font weight. Use this when you have a label hierarchy, such as checkboxes/radios in a fieldset |
| asChild | boolean | false | Change the default rendered element for the one passed as a child, merging their props and behavior. |
Usage
Examples
Weights
Story not found: WeightsEn
HTML
Use the class name ds-label to style an HTML <label> element.
Use data-weight to set the font weight.
CSS variables and data attributes
No relevant css variables found.
| Name | Value |
|---|---|
| data-weight | semibold, regular |