A shadcn-style field component built with Ark UI primitives.

Visible on your profile

Installation

npx shadcn@latest add @ark-cn/field

Usage

import * as Field from "@/components/ui/field"

Read exported parts in src/components/ui/field.tsx and compose the primitive according to the Ark UI pattern for this component.

Examples

Basic

Visible on your profile

Checkbox

Normal

Invalid

You must accept the terms and conditions.

Invalid

Please enter a valid email address.

Select

Normal

Choose your preferred UI framework.

Invalid

Please select a priority before submitting.

Combobox

Normal

Type to filter available options.

Invalid

Please select one team.

Editable

Normal

Ark CN
Click edit to update your public profile name.

Invalid

lowercase-hyphen-only
Use lowercase letters, numbers, and hyphens only.

Number Input

Normal

Age must be between 18 and 100.

Invalid

Please enter at least 1 seat.

Password Input

Normal

Use at least 8 characters for stronger security.

Invalid

Password must contain at least 8 characters.

Pin Input

Normal

Enter the 6-digit code sent to your email.

Invalid

Enter all 4 digits to continue.

Radio Group

Normal

Select the billing plan that fits your needs.

Invalid

Please choose a billing cycle.

Slider

Normal

Use arrow keys for precise adjustments.

Invalid

Set a value greater than or equal to 10.

Switch

Normal

Enable updates for account activity.

Invalid

You must accept the terms to continue.

File Upload

Normal

Drop a PDF file or click to browse
    Supported format: PDF (max 1 file).

    Invalid

    Only signed PDF files are accepted
      Please upload a signed PDF document.

      API reference

      This component mirrors the upstream Ark UI primitive.

      See the ARK UI documentation for the full API.