Skip to main content

Label

🌓Dark Mode Compatible

Overview​

Label provides accessible, consistent text for form controls. Use it to associate readable text with inputs and other controls.

Live Demo​

Live demoInteractive

Anatomy​

  • Root: The label element.
  • Text: The label content.

Usage​

import { Input, Label } from '@grasdouble/lufa_design-system';

export function Example() {
return (
<div>
<Label htmlFor="fullname">Full Name</Label>
<Input id="fullname" />
</div>
);
}

Props​

PropTypeDefaultDescription
htmlForstringundefinedThe id of the input this label controls.
asElementType'label'Polymorphic prop to render a different element.
childrenReactNodeundefinedThe label text.
classNamestringundefinedAdditional CSS classes.

Accessibility​

Always match htmlFor with the target input id to ensure screen readers announce the label.

Theming & Tokens​

Label uses typography tokens for font size and color, and updates with theme changes.

Do / Don’t​

Do

Keep label text short and descriptive.

Don’t

Avoid wrapping inputs inside labels unless you need that structure for layout.