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

Installation

npx shadcn@latest add @ark-cn/popover

Usage

import * as Popover from "@/components/ui/popover"

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

Examples

Close button

Controlled

Placement

Close behavior

Anchor

Same width

Lazy mount

Nested

In dialog

Context

Context open:false

Indicator only

No arrow

Initial focus

With field

Pattern aligned with Field composition.

usePopoverContext hook

usePopoverContext: 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.

PopoverPopup

PropTypeDescription
arrowClassName?stringClass on the arrow element.
arrowTipClassName?stringClass on the arrow tip.
disablePortal?booleanRenders content in-place instead of portaled.
positionerClassName?stringExtra class on the positioner wrapper.
showArrow?booleanToggles the arrow (default true).

See the ARK UI documentation for the full API.

Accessibility

See the Ark UI documentation for clarification.