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

Installation

npx shadcn@latest add @ark-cn/number-field

Usage

import * as NumberField from "@/components/ui/number-field"

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

Examples

Step

Variant

Scrubber

Label

Disabled

Format

API reference

This component mirrors the upstream Ark UI primitive. All props and DOM behavior are defined by Ark unless you see an ark-cn-only row below.

NumberFieldInput

PropTypeDescription
size?"sm" | "default" | "lg"Input group size.
inputClassName?stringClass on the inner input element.
inputProps?NumberFieldInputPropsForwarded to the underlying NumberField.Input.
controlProps?NumberFieldControlPropsForwarded to the wrapping Control.
withoutControl?booleanRenders only the input group without the wrapping Control.
showTrigger?booleanShows increment/decrement UI.
triggerVariant?"between" | "end"Placement of +/− controls.
startAddon?ReactNodeSlot before the input.
endAddon?ReactNodeSlot after the input.

See the ARK UI documentation for the full API.

Accessibility

See the Ark UI documentation for clarification.