This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
SplitButtonLayout
A Jetpack Compose SplitButtonLayout component for a primary action next to a button that opens related actions.
Expo UI SplitButtonLayout matches the official Jetpack Compose SplitButtonLayout API. It places a leading button for the primary action next to a trailing button, which usually opens a menu of related actions. Both buttons take the same height.
Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Split button with a menu
SplitButtonLayout has two slots: SplitButtonLayout.LeadingButton and SplitButtonLayout.TrailingButton. Put a SplitButtonLeadingButton in the leading slot. To open a menu from the trailing button, put a DropdownMenu in the trailing slot with a SplitButtonTrailingButton as the menu's trigger. The menu then opens below the button. Set checked on the trailing button while the menu is expanded. Material 3 changes the shape of a checked button to show that the menu is open.
The slots accept other content too. For example, wrap the trailing button in a TooltipBox to show a tooltip on long press.
Full-width split button
The layout measures the trailing button first and gives the leading button the remaining width. Apply fillMaxWidth() to both the layout and the leading button to make the split button span its container.
API
import { SplitButtonLayout } from '@expo/ui/jetpack-compose';
Components
Type: React.Element<SplitButtonLayoutProps>
A Material 3 split button layout: a leading button for the primary action and a trailing button, usually for a menu of related actions. Both buttons take the same height.
ReactNodeThe SplitButtonLayout.LeadingButton and SplitButtonLayout.TrailingButton slots.
Type: React.Element<SplitButtonLeadingButtonProps>
The leading button of a split button, which runs the primary action.
Goes in the SplitButtonLayout.LeadingButton slot.
Wraps SplitButtonDefaults.LeadingButton.
ButtonColorsColors for the button. Unset colors use ButtonDefaults.buttonColors().
boolean • Default: trueWhether the button is enabled for user interaction.
Type: React.Element<SplitButtonTrailingButtonProps>
The trailing button of a split button, which usually opens a DropdownMenu of related actions.
Goes in the SplitButtonLayout.TrailingButton slot.
Wraps SplitButtonDefaults.TrailingButton.
booleanWhether the trailing button is checked. This usually matches the menu's expanded state.
ButtonColorsColors for the button. Unset colors use ButtonDefaults.buttonColors().
boolean • Default: trueWhether the button is enabled for user interaction.