Skip to Content

Label

The Label component provides you with form labels and descriptions.

Live Examples

Live Example
☀️
Copy
View Code
import { Label, Input, HelperText } from '@jarllyng/nostromo' export default function LabelExample() { return ( <div className="w-full max-w-sm space-y-6"> <div className="grid gap-2"> <Label htmlFor="email">Email</Label> <Input id="email" type="email" placeholder="you@example.com" /> </div>...

Import

import { Label } from "@jarllyng/nostromo"; // or import { Label } from "@jarllyng/nostromo/label";

Usage

import { Label, Input } from "@jarllyng/nostromo"; export default function Example() { return ( <div className="space-y-2"> <Label htmlFor="email">Email</Label> <Input id="email" type="email" /> </div> ); }

With Checkbox

Live Example
☀️
Copy
View Code
import { Label, Checkbox } from '@jarllyng/nostromo' export default function LabelWithCheckbox() { return ( <div className="flex items-center space-x-2"> <Checkbox id="terms" /> <Label htmlFor="terms">Accept terms and conditions</Label> </div> ) }...

Props

PropTypeDefaultRequiredDescription
htmlForstringundefinedNoID of the form control this label is for
variant"default" | "muted" | "error""default"NoVisual variant
size"sm" | "default" | "lg""default"NoSize of the label
weight"normal" | "medium" | "semibold" | "bold""medium"NoFont weight
classNamestringundefinedNoAdditional CSS classes
childrenReact.ReactNodeundefinedNoLabel content

Standard HTML Label Props

The Label component extends React.LabelHTMLAttributes<HTMLLabelElement>, so it accepts all standard HTML label attributes (e.g., id, data-*, aria-*).

Last updated on