Label Preview

Labels give a name to a component or group of components. Pair them with components like checkboxes and inputs to prompt someone to enter certain information, or with plain text to categorize information.

When using a label with a form component to gather information, use the asterisk to indicate whether the information is required before moving on.

Loading...

Properties

as

“label”
Default:
none

disabled

Renders the label as disabled

boolean
Default:
false

required

Displays an indicator that the label is for a required field. The required prop can be set to true to display an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.

boolean | WithSlotShorthandValue<{ as?: "span"; } & Pick<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof HTMLAttributes<...>> & { ...; } & { ...; }> | null
Default:
false

size

A label supports different sizes.

“small” “medium” “large”
Default:
“‘medium’”

weight

A label supports regular and semibold fontweight.

“regular” “semibold”
Default:
“regular”