@presetui/primitives
v0.2.0
Published
Headless UI primitives from PresetUI — the same files you can copy, installable.
Maintainers
Readme
@presetui/primitives
Headless UI primitives from PresetUI — unstyled compound components in the spirit of Radix UI, plain JavaScript with types generated from JSDoc.
Popover · Dropdown Menu (with submenus) · Listbox (custom select) ·
Combobox · Tooltip · Dialog (on the native <dialog>) · Toast — plus the
shared core (positioning, dismiss layers, controllable state, roving focus,
typeahead, asChild prop merging).
npm install @presetui/primitivesimport { Popover, PopoverContent, PopoverTrigger } from "@presetui/primitives/popover"
<Popover>
<PopoverTrigger asChild>
<button>Open</button>
</PopoverTrigger>
<PopoverContent side="bottom" className="your-styles">…</PopoverContent>
</Popover>The contract:
- Zero styling — style via
data-state,data-side,data-highlighted,data-disabledattributes. - Every part forwards
className,style,ref, and all DOM props; triggers acceptasChild. - WAI-ARIA patterns and full keyboard maps, documented in each module's header comment.
- No dependencies; React 19+ peer only.
Prefer owning the code? Every primitive is also a single copyable file:
https://presetui.com/r/primitives/<name>.txt (shared core embedded). This
package is built from those same files.
MIT.
