Components
Label

Label

The Label component provides you with form labels and descriptions.

Import

import { Label } from '@nostromo/ui-core'
// or
import { Label } from '@nostromo/ui-core/label'

Usage

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

Live Examples

Live Example
☀️
Copy
Storybook →
View Code
import { Label } from '@nostromo/ui-core' export default function LabelExample() { return ( <div className="space-y-4"> <div> <Label htmlFor="email">Email</Label> <input id="email" type="email" className="mt-1" /> </div> ...

With Checkbox

Live Example
☀️
Copy
Storybook →
View Code
import { Label, Checkbox } from '@nostromo/ui-core' 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-*).