Field
@/components/kamod-ui/field
Installation
Import Field and subcomponents from `@/components/kamod-ui/field` (FieldSet, FieldGroup, FieldLabel, FieldDescription, FieldError, …).
pnpm add @kamod-ch/uiUsage
Compose Field around controls. Use FieldSet + FieldLegend for semantics. Field orientation horizontal for checkbox/radio + label rows. FieldLabel can wrap a Field for choice cards. Field still accepts label, description, and error props for quick stacks (legacy).
import { Field } from "@/components/kamod-ui/field";<Field />Anatomy
FieldSet, FieldGroup, label, control, description, error (shadcn Usage).
Legacy props
Field with label, description, and error props (backward compatible).
Shown in the dashboard header
Input
Username and password fields (shadcn Field Input).
Textarea
shadcn Field Textarea.
Select
shadcn Field Select.
Select your department or area of work.
Slider
FieldTitle + FieldDescription + Slider (shadcn Field Slider, single value).
Max budget: 50 (demo slider).
Fieldset
Legend, description, grid of inputs (shadcn Fieldset).
Checkbox
Horizontal Field rows + FieldContent (shadcn Field Checkbox).
Your Desktop & Documents are synced with cloud storage.
Radio
RadioGroup inside FieldSet (shadcn Field Radio).
Switch
Label + Switch horizontal (shadcn Field Switch).
Choice card
FieldLabel wraps Field + Radio (shadcn Choice Card).
Field group + separator
Stacked FieldSets with FieldSeparator (shadcn Field Group).
FieldError (errors array)
FieldError can derive text from an errors array (forms integration).
- Too short
- Must contain a number
Responsive orientation
Field orientation responsive stacks until @md inside @container FieldGroup.
Resize the viewport to see layout change.
Legacy error
Validation with legacy error prop.
Please provide a valid email address
API Reference
Props, slots and variants for this component.
Field
Field component props and accepted values.
| Prop | Type | Default |
|---|---|---|
| orientation | "vertical" | "horizontal" | "responsive" | "vertical" |
| disabled | boolean | false |
| invalid | boolean | false |
| label / description / error | ComponentChildren | legacy only |
| FieldLabel htmlFor | string | — |
| FieldError errors | { message?: string }[] | undefined |
Accessibility Notes
Use FieldLabel with htmlFor matching control id. Surface validation with aria-invalid on the control and FieldError or error prop. FieldSet and FieldLegend group related inputs for assistive tech.