Shown on invoices and in the client portal.
npx shadcn@latest add https://sdk-components.thesqd.com/r/field-label.jsonimport { FieldLabel } from "@/components/ui/field-label";import { FieldLabel } from "@/components/ui/field-label";
import { Input } from "@/components/ui/input";
export function Example() {
return (
<div className="flex flex-col gap-1.5">
<FieldLabel
htmlFor="project-name"
label="Project name"
caption="Shown on invoices and in the client portal."
required
/>
<Input id="project-name" placeholder="Acme rebrand" />
</div>
);
}FieldLabel (single component — pass everything as props)
├── label={<ReactNode>} (required — the visible label text)
├── caption={<ReactNode>} (optional helper text under the label)
├── required={boolean} (renders a red asterisk after the label)
├── error={boolean} (reddens the label — render the message below the control)
├── disabled={boolean} (softens label / caption color)
└── htmlFor={string} (wires <label htmlFor> to the control id)Shown on invoices and in the client portal.
Shown on invoices and in the client portal.
Project name is required.
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | — | Visible label text rendered above the control. |
caption | ReactNode | — | Helper text rendered directly under the label (not under the control). |
required | boolean | false | Renders a red asterisk after the label. |
error | boolean | false | Marks the field invalid — reddens the label. Render the error message below the control. |
disabled | boolean | false | Softens the label / caption color. |
htmlFor | string | — | Wires the underlying `<label htmlFor>` to the control's id. |
className | string | — | Override or extend the wrapper classes. |