Label

Renders an accessible label associated with controls.

Overview

The Label component renders a semantic native label for form controls. Wrap the control when the label owns a small inline or vertical field composition, or use htmlFor when the label and control need to stay separate.

Usage

import { Input } from "@tilt-legal/cubitt-components/input";
import { Label } from "@tilt-legal/cubitt-components/label";
<Label>
  Email
  <Input type="email" placeholder="Enter your email" />
</Label>

Examples

With input

With switch

Sizes

Orientations

With Select

With Textarea

Props

Label

PropTypeDefaultDescription
htmlForstring-The id of the form control this label is associated with
size"xs" | "sm" | "md" | "lg""md"The size of the label text and spacing
orientation"vertical" | "horizontal""vertical"Layout direction for label content
classNamestring-Additional CSS classes to apply to the label
childrenReact.ReactNode-The content of the label
...propsReact.ComponentProps<"label">-Native label props

LabelDescription

Size-aware helper text rendered under the main label.

PropTypeDefaultDescription
size"xs" | "sm" | "md" | "lg""md"Matches the parent label/control size
classNamestring-Additional CSS classes
childrenReact.ReactNode-Description content

Design Guidelines

Accessibility and association

  • Associate labels with form controls by wrapping the control or using htmlFor with a matching control id
  • Use descriptive text that clearly explains what the associated control is for
  • Avoid placeholder-only forms - labels should always be visible, not just placeholder text
  • Use sentence case rather than title case for better readability

Layout and positioning

  • Use vertical orientation for traditional form fields (inputs, selects, textareas) to improve scanability
  • Use horizontal orientation for checkboxes, radio buttons, and switches to maintain natural reading flow
  • Use consistent spacing between labels and their associated controls - the component handles appropriate gap sizes automatically
  • Align labels left for better readability in forms

Sizing

  • Use consistent sizes throughout your form for visual hierarchy
  • Match label size with the associated form control size when possible
  • Use smaller sizes (xs, sm) for compact forms or secondary information
  • Use larger sizes (lg) for prominent form fields or headings

Best practices

  • Use wrapping when the label owns a compact checkbox, radio, switch, or vertical field composition
  • Use htmlFor association when the label and control are separate siblings
  • Maintain semantic meaning - labels should always describe the purpose of their associated control

On this page