OPUS/UI

Navigation

Field

Label, description and error around any control — ids, aria-describedby and aria-invalid are wired for you.

2 files · 127 locdeps: clsx, tailwind-merge
/
https://.com

We’ll link it from your public profile.

Forgot?

Installation

With the shadcn CLI, pointing at this platform’s registry:

npx shadcn@latest add https://opusui.131199999.xyz/r/field.json

Or offline, straight from your opus55 checkout (copies every file it needs):

node ../tailwind_component/opus55/scripts/add.mjs field

Usage

import { Field } from "@/components/opus/ui/field";

<Field label="Email" description="We never share it." error={errors.email}>
  <Input type="email" />
</Field>

API

PropTypeDefaultDescription
labelReactNode—Label text — clicking it focuses the control.
descriptionReactNode—Helper text (hidden while an error shows).
errorReactNode—Error message; flips the control to invalid.
requiredboolean—Adds a red asterisk and aria-required.
horizontalboolean—Label and control on one row — for switches and checkboxes.
labelAsideReactNode—Right side of the label row, e.g. “Forgot password?”.

Command palette