Kinetik UI

Split Button

.md

A primary action with alternatives behind a chevron; a new pick rolls into the label as the button resizes.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add split-button

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/split-button.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/split-button.tsx
    View source files

Usage

import { SplitButton } from '@/components/kinetik/split-button';

<SplitButton
  options={[
    { value: 'merge', label: 'Merge', description: 'Keep every commit' },
    { value: 'squash', label: 'Squash and merge', description: 'One commit on main' },
  ]}
  value={method}
  onValueChange={setMethod}
  onPress={(m) => merge(m)}
/>;

The main half runs onPress with the chosen value. Picking another option in the menu only changes the choice; people press the button to run it, so a pick in the menu never acts by surprise.

When to use

  • One default action with two to five close variants: publish now or schedule, merge methods, export formats.
  • Actions where people tend to stick with their last choice. Persist value to remember it.

When not to use

  • Unrelated actions. Use Pop Menu.
  • Two options of equal weight. Use two buttons.

Notes

  • Every label is measured once, out of sight, so the button springs straight to the right width.
  • The menu opens in a transparent modal under the button's right edge and stays 12 pt inside the window.
  • With reduced motion the label and width change at once.

Props

SplitButtonProps

PropTypeDefaultDescription
optionsrequiredreadonly SplitButtonOption[]—
valuerequiredstring—The chosen option, which the main half runs.
onValueChangerequired(value: string) => void—
onPressrequired(value: string) => void—Runs the chosen option.
tone'ember' | 'azure''ember'Defaults to `ember`, the theme's strongest ink.
menuLabelstring'More options'Names the menu button. Defaults to 'More options'.
hapticsbooleantrueA tick when the menu opens and on a new choice. Defaults to true.
disabledbooleanfalse
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Plain views; labels are measured once. The menu is a modal mounted only while open. Nothing runs at rest.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.85× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 140 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
The label and width change at once, and the menu appears in place.
Screen readers
Two buttons: the action, named by the current label, and More options with an expanded state. Menu items read their description and mark the current one as selected.
Touch target
Both halves are 48 pt tall; the chevron half is 48 pt wide.

Source files

components/kinetik/split-button.tsx is in the Code tab of the preview above.