PACKAGES

@plumeria/headlessui

★★★★☆ Stable

A 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.

Terminal
pnpm i @plumeria/headlessui

How 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

  • Item
  • Header
  • Trigger
  • Content

AlertDialog

  • Trigger
  • Portal
  • Overlay
  • Content
  • Title
  • Description
  • Action
  • Cancel

Avatar

  • Image
  • Fallback

Checkbox

  • Indicator

Collapsible

  • Trigger
  • Content

ContextMenu

  • Trigger
  • Portal
  • Content
  • Group
  • Label
  • Item
  • CheckboxItem
  • RadioGroup
  • RadioItem
  • ItemIndicator
  • Separator
  • Arrow
  • Sub
  • SubTrigger
  • SubContent

Dialog

  • Trigger
  • Portal
  • Overlay
  • Content
  • Title
  • Description
  • Close
  • Trigger
  • Portal
  • Content
  • Group
  • Label
  • Item
  • CheckboxItem
  • RadioGroup
  • RadioItem
  • ItemIndicator
  • Separator
  • Arrow
  • Sub
  • SubTrigger
  • SubContent

Label

  • Menu
  • Trigger
  • Portal
  • Content
  • Group
  • Label
  • Item
  • CheckboxItem
  • RadioGroup
  • RadioItem
  • ItemIndicator
  • Separator
  • Arrow
  • Sub
  • SubTrigger
  • SubContent
  • Sub
  • List
  • Item
  • Trigger
  • Link
  • Indicator
  • Content
  • Viewport

Popover

  • Trigger
  • Portal
  • Content
  • Close
  • Arrow
  • Anchor

Progress

  • Indicator

RadioGroup

  • Item
  • Indicator

ScrollArea

  • Viewport
  • Scrollbar
  • Thumb
  • Corner

Select

  • Trigger
  • Value
  • Icon
  • Portal
  • Content
  • Viewport
  • Group
  • Label
  • Item
  • ItemText
  • ItemIndicator
  • ScrollUpButton
  • ScrollDownButton
  • Separator
  • Arrow

Separator

Slider

  • Track
  • Range
  • Thumb

Switch

  • Thumb

Tabs

  • List
  • Trigger
  • Content

Toast

  • Provider
  • Viewport
  • Title
  • Description
  • Action
  • Close

Toggle

ToggleGroup

  • Item

Tooltip

  • Provider
  • Trigger
  • Portal
  • Content
  • Arrow

VisuallyHidden

Edit on GitHub