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

Installation

npx shadcn@latest add @ark-cn/select

Usage

import * as Select from "@/components/ui/select"

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

Examples

Basic

Controlled

value: vite

Root provider

Multiple + select all

Grouping

Field

Pick one for the starter template.

Form

Async load

Open the menu to load the full list.

Lazy mount

Overflow

Sizes

Disabled

Wider popup

With label

Trigger icon

Options with icon

Object values

Clear (ButtonGroup)

Invalid

Read-only

Deselectable

Empty

useSelectContext

useSelectContext: Next.js

closeOnSelect false

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.

Select

PropTypeDescription
children?ReactNode | ((api: UseSelectContext<T>) => ReactNode)Render-prop or static children.
items?T[]List of items when not passing a custom collection.
collection?ListCollection<T>Pre-built collection (alternative to items).

SelectTriggerField

PropTypeDescription
size?ButtonSizeOutline trigger button size.
showClear?booleanShows a clear control in the trigger.
hideIndicator?booleanHides the dropdown indicator.
containerClass?stringClass on the wrapping ButtonGroup.

SelectPopup

PropTypeDescription
disablePortal?booleanRenders content in-place instead of portaled.

SelectValue

PropTypeDescription
children?(api: UseSelectContext<T>) => ReactNodeCustom value rendering.
placeholder?stringEmpty-state label.

See the ARK UI documentation for the full API.

Accessibility

See the Ark UI documentation for clarification.