Field

@/components/kamod-ui/field

Profile

This appears on invoices and emails.

This appears on invoices and emails.

Installation

Import Field and subcomponents from `@/components/kamod-ui/field` (FieldSet, FieldGroup, FieldLabel, FieldDescription, FieldError, …).

pnpm add @kamod-ch/ui

Usage

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).

Choose a unique username for your account.

Must be at least 8 characters long.

Textarea

shadcn Field Textarea.

Share your thoughts about our service.

Select

shadcn Field Select.

Select your department or area of work.

Slider

FieldTitle + FieldDescription + Slider (shadcn Field Slider, single value).

Price cap

Max budget: 50 (demo slider).

Fieldset

Legend, description, grid of inputs (shadcn Fieldset).

Address Information

We need your address to deliver your order.

Checkbox

Horizontal Field rows + FieldContent (shadcn Field Checkbox).

Desktop items

Select items to show on the desktop.

Your Desktop & Documents are synced with cloud storage.

Radio

RadioGroup inside FieldSet (shadcn Field Radio).

Subscription Plan

Yearly and lifetime plans offer savings.

Switch

Label + Switch horizontal (shadcn Field Switch).

Choice card

FieldLabel wraps Field + Radio (shadcn Choice Card).

Compute Environment

Select the compute environment for your cluster.

Field group + separator

Stacked FieldSets with FieldSeparator (shadcn Field Group).

Get notified when long requests finish.

Updates for tasks you created.

FieldError (errors array)

FieldError can derive text from an errors array (forms integration).

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.

API Reference

Props, slots and variants for this component.

Field

Field component props and accepted values.

PropTypeDefault
orientation"vertical" | "horizontal" | "responsive""vertical"
disabledbooleanfalse
invalidbooleanfalse
label / description / errorComponentChildrenlegacy only
FieldLabel htmlForstring
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.