Skip to main content

Module split_button

Module split_button 

Source
Expand description

Ported from Arc (MIT) © 2026 Elia Kuratli Reference: Arc源码/arc-library/registry/components/split-button/split-button.tsx & .module.css

P2 Component #4: split-button

  • One joined control with two halves: primary action button + trailing chevron menu trigger.
  • Primary press scales the whole pill (0.97, backdrop canvas); menu trigger press answers in color only so the anchored menu always measures a still trigger rect.
  • Variants: Primary (ControlHeights::MD, Radii::CONTROL, foreground surface) and Secondary (ControlHeights::SM, Radii::PILL, surface fill with border).
  • Floating menu: ArcPresence (y: -5px -> 0, 130ms exit), staggered items (35ms capped at 4), rotating 0° -> 180° chevron (PathBuilder + motion.spring.snappy), keyboard navigation (ArrowDown/ArrowUp/Enter/Escape), destructive styling, and outside dismiss.

Structs§

SplitButton
Arc SplitButton joining one primary action with a dropdown menu of sibling actions.
SplitButtonAction
One menu item inside a SplitButton dropdown.

Enums§

SplitButtonVariant
Visual style for SplitButton.