PACKAGES
@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.
pnpm i @plumeria/headlessuiHow classStyle works
@plumeria/headlessui is a dependency the build never scans, so a classStyle written on one of its components is 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 { Dialog } 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>;A component of your own can compose a style it receives onto a part:
export const OpenButton = ({ classStyle }: { classStyle?: css.Style }) => (
<Dialog.Trigger classStyle={[styles.primary, classStyle]}>Open</Dialog.Trigger>
);Interactive Demo
Below is a live demo of twenty of the twenty-five component groups, styled with Plumeria.
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