Label

Label Primitive

Headless, unstyled label primitive with full accessibility support.

Basic Headless Primitive

The primitive provides semantic HTML <label> behavior without styling.

Click the label to focus the input field.

With Form Elements

Labels work with all standard form input types.

Required Fields

Common labeling pattern for required and optional fields.

Accessibility Features

Built-in accessibility support follows WAI-ARIA patterns.

Keyboard Shortcuts

Navigate forms using keyboard.

Navigate between inputs Tab
Click label to focus input Click

When to Use Primitives

Choose between primitives and styled components based on your needs.

Use Label Primitive

  • Building a custom design system
  • Need complete control over styling
  • Want to apply your own CSS framework
  • Creating unique visual designs

Use Styled Component

  • Want shadcn/ui design out of the box
  • Need quick implementation
  • Like the default styling
  • Prefer convention over configuration

API Reference

Component parameters and their types.

Prop Type Default Description
For string? The ID of the form element this label is associated with. Maps to the HTML for attribute.
ChildContent RenderFragment? Content rendered inside the label element.
AdditionalAttributes IReadOnlyDictionary&lt;string, object&gt;? Additional attributes (such as class or style) passed to the label element.

Reconnecting...

Attempting to rejoin the server

Connection Lost

Retrying in seconds

Connection Failed

Failed to rejoin the server.
Please retry or reload the page.

Session Paused

The session has been paused by the server

Resume Failed

Failed to resume the session.
Please reload the page.