Label
A form label primitive with required and secondary text markers.
import { Label, LabelAsterisk } from "raft-ui";
<Label>
<LabelAsterisk />
</Label>API#WIP
| 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. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | "*" | Marker content for required fields. |
...props | ComponentProps<"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. |
| 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. |