Installation
Section titled “Installation”- Package
@bigbang/ui- Import
import { SplitButton } from '@bigbang/ui';- Source
- SplitButton.tsx
- Storybook
- SplitButton · Playground
SplitButton is in the @bigbang/ui package. The menu item type is exported as SplitButtonAction.
import { SplitButton } from '@bigbang/ui';
<SplitButton onClick={save} menuLabel="More save options" actions={[{ label: 'Save as draft', onSelect: saveDraft }]}> Save</SplitButton>;childrenRequired- Description
- Label of the main action, a short verb phrase such as "Kaydet".
- Type
string
onClick- Description
- Runs the main action.
- Type
MouseEventHandler<HTMLButtonElement>
actionsRequired- Description
- Related actions in the menu, such as "Taslak olarak kaydet".
- Type
readonly SplitButtonAction[]
variant- Description
- How important the action is. Use one
primaryper area. - Type
'primary' | 'secondary'- Default
'primary'
tone- Description
dangermarks a main action that deletes or cannot be undone.- Type
'neutral' | 'danger'- Default
'neutral'
size- Description
- Height of 32, 36 or 40 px, the Button heights.
- Type
'sm' | 'md' | 'lg'- Default
'md'
disabled- Description
- Turns off both parts.
- Type
boolean- Default
false
type- Description
- Form behaviour of the main action. Use
'submit'when it submits the form. - Type
'button' | 'submit' | 'reset'- Default
'button'
className- Description
- For layout only: margins and placement.
- Type
string
SplitButtonAction: label, onSelect, optional icon and disabled.
Data attributes
Section titled “Data attributes”data-component="button-group": on the root.data-part="main"anddata-part="menu-trigger": on the two buttons.data-popup-open: on the menu button while the menu is open (Base UI).data-component="split-button-menu": on the menu.