Skip to content
Hazine

Split and menu buttons

1 of 5 shipped. Each take is a different structure, and the note under its title says how.

  • split and menu buttons

    Two focus stops in one group: the main half runs the default action, the caret is a named menu button whose items are alternative actions that run on choice, in a menu as wide as the group.

    shadcn add @hazine/split-button-menu

    Depends on button, button-group, dropdown-menu, @hazine/use-controllable-state, lucide-react

Planned 4

  • Split Button with Remembered Choice

    Menu items are menuitemradio and selecting one only relabels the primary button without executing; the selection persists to localStorage with an SSR-safe default, and the relabel is announced politely.

  • Split Button with Option Toggles

    The menu contains menuitemcheckbox modifiers rather than alternative actions, stays open on toggle, and the primary half shows a small suffix with the number of active options; the handler receives the option set as an argument.

  • Send or Schedule Split Button

    The attached half opens a non-modal popover with form controls instead of a menu; picking a time rewrites the primary label and adds a clear-schedule control, and focus returns to the primary button on close.

  • Menu Button with Described Options

    One trigger with no default action, and two-line rich rows in a 288px menu; each description is tied to its item with aria-describedby so typeahead and the item name use only the title.