Field

GitHub

Field label with an optional required-field indicator and accessible required-state title.

Installation

bash
pnpm dlx shadcn@latest add @cs/field

Usage

tsx
import { FieldLabel } from "@/components/cs/field";
tsx
<FieldLabel htmlFor="email" required>Email address</FieldLabel>

API Reference

FieldLabel

Field label with an optional required-field indicator.

Props

NameTypeDefaultDescription
requiredbooleanfalseShows a required-field indicator and title.

Dependencies