API
@plumeria/headlessui
A curated set of headless primitives built on Radix UI and styled with Plumeria.
@plumeria/headlessui is a curated set of essential headless primitives, built on Radix UI
Installation headlessui
Using @plumeria/headlessui requires the configuration of @plumeria/core and your bundler.
Please refer to the Installation section for details.
npm i @plumeria/headlessuiyarn add @plumeria/headlessuipnpm i @plumeria/headlessuiHow classStyle works
When classStyle is passed to a custom component, it is automatically compiled to className and style at the call site — before the component ever runs.
Therefore, each @plumeria/headlessui component does not need to know about classStyle at all; it simply spreads ...props onto the underlying Radix primitive.
import * as css from '@plumeria/core';
import { DialogTrigger } from '@plumeria/headlessui';
const styles = css.create({
primary: {
padding: '10px',
backgroundColor: 'navy',
color: '#fff',
},
});
// classStyle is compiled to className="xxxxxxxx" at this call site
<Dialog.Trigger classStyle={styles.primary}>Open</Dialog.Trigger>;Interactive Demo
Below is a live demo of twenty of the twenty-five component groups, styled with Plumeria.
Dialog
Popover
Tooltip
Accordion
Tabs
Collapsible
DropdownMenu
Select
Checkbox
Switch
RadioGroup
Slider
ContextMenu
Right click hereMenubar
NavigationMenu
Toast
Toggle
ToggleGroup
ScrollArea
AlertDialog
Components
The following twenty-five component groups are exported. All components support ref forwarding and props spread.
Accordion
ItemHeaderTriggerContent
AlertDialog
TriggerPortalOverlayContentTitleDescriptionActionCancel
Avatar
ImageFallback
Checkbox
Indicator
Collapsible
TriggerContent
ContextMenu
TriggerPortalContentGroupLabelItemCheckboxItemRadioGroupRadioItemItemIndicatorSeparatorArrowSubSubTriggerSubContent
Dialog
TriggerPortalOverlayContentTitleDescriptionClose
DropdownMenu
TriggerPortalContentGroupLabelItemCheckboxItemRadioGroupRadioItemItemIndicatorSeparatorArrowSubSubTriggerSubContent
Label
Menubar
MenuTriggerPortalContentGroupLabelItemCheckboxItemRadioGroupRadioItemItemIndicatorSeparatorArrowSubSubTriggerSubContent
NavigationMenu
SubListItemTriggerLinkIndicatorContentViewport
Popover
TriggerPortalContentCloseArrowAnchor
Progress
Indicator
RadioGroup
ItemIndicator
ScrollArea
ViewportScrollbarThumbCorner
Select
TriggerValueIconPortalContentViewportGroupLabelItemItemTextItemIndicatorScrollUpButtonScrollDownButtonSeparatorArrow
Separator
Slider
TrackRangeThumb
Switch
Thumb
Tabs
ListTriggerContent
Toast
ProviderViewportTitleDescriptionActionClose
Toggle
ToggleGroup
Item
Tooltip
ProviderTriggerPortalContentArrow