Label
A form label primitive with required and secondary text markers.
import { Label, LabelAsterisk } from "raft-ui";
<Label>
<LabelAsterisk />
</Label>childrenReactNode
Visible label content. Compose LabelAsterisk, LabelOptional, or LabelSub inside it.
htmlForstring
Native label association with the matching control id.
sizedefault: "md""sm" | "md"
Label text size. Use sm for dense settings rows.
disableddefault: falseboolean
Sets aria-disabled and disabled styling on the label. It does not disable the control.
renderReactElement | (props, state) => ReactElement
Replace the rendered element when composing into a custom form pattern.
...propsComponentProps<"label">
Native label attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Visible label content. Compose LabelAsterisk, LabelOptional, or LabelSub inside it. |
htmlFor | string | — | Native label association with the matching control id. |
size | "sm" | "md" | "md" | Label text size. Use sm for dense settings rows. |
disabled | boolean | false | Sets aria-disabled and disabled styling on the label. It does not disable the control. |
render | ReactElement | (props, state) => ReactElement | — | Replace the rendered element when composing into a custom form pattern. |
...props | ComponentProps<"label"> | — | Native label attributes. |
childrendefault: "*"ReactNode
Marker content for required fields.
...propsComponentProps<"span">
Native span attributes for rare custom markers or tests.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | "*" | Marker content for required fields. |
...props | ComponentProps<"span"> | — | Native span attributes for rare custom markers or tests. |
childrendefault: "(optional)"ReactNode
Marker content shown after the label.
...propsComponentProps<"span">
Native span attributes for rare custom markers or tests.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | "(optional)" | Marker content shown after the label. |
...props | ComponentProps<"span"> | — | Native span attributes for rare custom markers or tests. |
childrenReactNode
Custom secondary copy shown after the label.
...propsComponentProps<"span">
Native span attributes for rare custom markers or tests.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Custom secondary copy shown after the label. |
...props | ComponentProps<"span"> | — | Native span attributes for rare custom markers or tests. |