PACKAGES
@plumeria/headlessui
★★★★☆ StableA curated set of headless primitives built on Radix UI and styled with Plumeria.
@plumeria/headlessui is a set of headless primitives built on Radix UI.
Installation
Set up @plumeria/core and your bundler first; see Installation.
pnpm i @plumeria/headlessuiHow sx works
@plumeria/headlessui is a dependency the build never scans, so an sx written on one of its components is compiled to className and style at the call site, before the component runs.
The components know nothing about sx; each one 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',
},
});
// sx is compiled to className="xxxxxxxx" at this call site
<Dialog.Trigger sx={styles.primary}>Open</Dialog.Trigger>;A component of your own can compose a style it receives onto a part:
export const OpenButton = ({ sx }: { sx?: css.Style }) => (
<Dialog.Trigger sx={[styles.primary, sx]}>Open</Dialog.Trigger>
);Interactive demo
Below is a live demo of twenty of the twenty-five component groups, styled with Plumeria.
Components
The package exports twenty-five component groups. Every component forwards ref and spreads its props.
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