---
title: SplitButtonLayout
description: A Jetpack Compose SplitButtonLayout component for a primary action next to a button that opens related actions.
sourceCodeUrl: 'https://github.com/expo/expo/tree/sdk-58/packages/expo-ui'
packageName: '@expo/ui'
platforms: ['android', 'expo-go']
---

This documentation is available as Markdown for AI agents and LLMs. See the [full Markdown index](https://docs.expo.dev/llms.txt) 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.

<AgentInstructions>

## Submitting Feedback

If you encounter errors, misleading or outdated information, report it so Expo can be improved:

Preferred command:
npx --yes submit-expo-feedback@latest --category docs --subject "/versions/latest/sdk/ui/jetpack-compose/splitbuttonlayout/" "<actionable feedback>"

Direct HTTP fallback:
curl -X POST https://api.expo.dev/v2/feedback/docs-send -H 'Content-Type: application/json' -d '{"url":"/versions/latest/sdk/ui/jetpack-compose/splitbuttonlayout/","feedback":"🤖 Agent feedback for docs: <specific, actionable description> (<model>, <harness>)"}'

Only submit when you have something specific and actionable to report. Try to give the most context.

## Navigation

When answering a related or follow-up question, use llms.txt to find the relevant page as Markdown (.md) instead of guessing.

You are here: Reference (v58.0.0) > Expo UI > Jetpack Compose (55 pages in this section)
Full documentation tree: [llms.txt](https://docs.expo.dev/llms.txt)

</AgentInstructions>
Android, Included in Expo Go

Expo UI SplitButtonLayout matches the official Jetpack Compose [`SplitButtonLayout`](https://kotlinlang.org/api/compose-multiplatform/material3/androidx.compose.material3/-split-button-layout.html) 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

```sh
# npm
npx expo install @expo/ui

# yarn
yarn expo install @expo/ui

# pnpm
pnpm expo install @expo/ui

# bun
bun expo install @expo/ui
```

If you are installing this in an [existing React Native app](https://docs.expo.dev/bare/overview.md), make sure to [install `expo`](https://docs.expo.dev/bare/installing-expo-modules.md) 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`](https://docs.expo.dev/versions/latest/sdk/ui/jetpack-compose/dropdownmenu.md) 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.

```tsx SplitButtonWithMenu.tsx
import {
  DropdownMenu,
  DropdownMenuItem,
  Host,
  Icon,
  SplitButtonLayout,
  SplitButtonLeadingButton,
  SplitButtonTrailingButton,
  Text,
} from '@expo/ui/jetpack-compose';
import { rotate } from '@expo/ui/jetpack-compose/modifiers';
import { useState } from 'react';

const DROP_DOWN_ICON = require('./assets/arrow_drop_down.xml');

export default function SplitButtonWithMenu() {
  const [expanded, setExpanded] = useState(false);

  return (
    <Host matchContents>
      <SplitButtonLayout>
        <SplitButtonLayout.LeadingButton>
          <SplitButtonLeadingButton
            onClick={() => console.log('Send')}>
            <Text>Send</Text>
          </SplitButtonLeadingButton>
        </SplitButtonLayout.LeadingButton>
        <SplitButtonLayout.TrailingButton>
          <DropdownMenu
            expanded={expanded}
            onDismissRequest={() => setExpanded(false)}>
            <DropdownMenu.Trigger>
              <SplitButtonTrailingButton
                checked={expanded}
                onCheckedChange={setExpanded}>
                <Icon
                  source={DROP_DOWN_ICON}
                  contentDescription="Send options"
                  modifiers={[rotate(expanded ? 180 : 0)]}
                />
              </SplitButtonTrailingButton>
            </DropdownMenu.Trigger>
            <DropdownMenu.Items>
              <DropdownMenuItem onClick={() => setExpanded(false)}>
                <DropdownMenuItem.Text>
                  <Text>Schedule send</Text>
                </DropdownMenuItem.Text>
              </DropdownMenuItem>
            </DropdownMenu.Items>
          </DropdownMenu>
        </SplitButtonLayout.TrailingButton>
      </SplitButtonLayout>
    </Host>
  );
}
```

The slots accept other content too. For example, wrap the trailing button in a [`TooltipBox`](https://docs.expo.dev/versions/latest/sdk/ui/jetpack-compose/tooltip.md) 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.

```tsx FullWidthSplitButton.tsx
import {
  Host,
  Icon,
  SplitButtonLayout,
  SplitButtonLeadingButton,
  SplitButtonTrailingButton,
  Text,
} from '@expo/ui/jetpack-compose';
import { fillMaxWidth } from '@expo/ui/jetpack-compose/modifiers';

const DROP_DOWN_ICON = require('./assets/arrow_drop_down.xml');

export default function FullWidthSplitButton() {
  return (
    <Host
      matchContents={{ vertical: true }}
      style={{ width: '100%' }}>
      <SplitButtonLayout modifiers={[fillMaxWidth()]}>
        <SplitButtonLayout.LeadingButton>
          <SplitButtonLeadingButton
            onClick={() => console.log('Merge')}
            modifiers={[fillMaxWidth()]}>
            <Text>Squash and merge</Text>
          </SplitButtonLeadingButton>
        </SplitButtonLayout.LeadingButton>
        <SplitButtonLayout.TrailingButton>
          <SplitButtonTrailingButton checked={false}>
            <Icon
              source={DROP_DOWN_ICON}
              contentDescription="Merge options"
            />
          </SplitButtonTrailingButton>
        </SplitButtonLayout.TrailingButton>
      </SplitButtonLayout>
    </Host>
  );
}
```

## API

```tsx
import { SplitButtonLayout } from '@expo/ui/jetpack-compose';
```

## Components

### `SplitButtonLayout`

Supported platforms: Android.

Type: React.[Element](https://www.typescriptlang.org/docs/handbook/jsx.html#function-component)<[SplitButtonLayoutProps](https://docs.expo.dev/versions/latest/sdk/ui/jetpack-compose/splitbuttonlayout.md#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.

SplitButtonLayoutProps

### `children`

Supported platforms: Android.

Type: [ReactNode](https://reactnative.dev/docs/react-node)

The `SplitButtonLayout.LeadingButton` and `SplitButtonLayout.TrailingButton` slots.

### `modifiers`

Supported platforms: Android.

Optional • Type: `ModifierConfig[]`

Modifiers for the component.

### `spacing`

Supported platforms: Android.

Optional • Type: `number` • Default: `SplitButtonDefaults.Spacing`

The space between the leading and trailing buttons, in dp.

### `SplitButtonLeadingButton`

Supported platforms: Android.

Type: React.[Element](https://www.typescriptlang.org/docs/handbook/jsx.html#function-component)<[SplitButtonLeadingButtonProps](https://docs.expo.dev/versions/latest/sdk/ui/jetpack-compose/splitbuttonlayout.md#splitbuttonleadingbuttonprops)\>

The leading button of a split button, which runs the primary action. Goes in the `SplitButtonLayout.LeadingButton` slot. Wraps `SplitButtonDefaults.LeadingButton`.

SplitButtonLeadingButtonProps

### `children`

Supported platforms: Android.

Type: [ReactNode](https://reactnative.dev/docs/react-node)

Content to display inside the button.

### `colors`

Supported platforms: Android.

Optional • Type: [ButtonColors](https://docs.expo.dev/versions/v58.0.0/sdk/ui/jetpack-compose/button.md#buttoncolors)

Colors for the button. Unset colors use `ButtonDefaults.buttonColors()`.

### `enabled`

Supported platforms: Android.

Optional • Type: `boolean` • Default: `true`

Whether the button is enabled for user interaction.

### `modifiers`

Supported platforms: Android.

Optional • Type: `ModifierConfig[]`

Modifiers for the component.

### `onClick`

Supported platforms: Android.

Optional • Type: `() => void`

Callback that is called when the leading button is clicked.

### `SplitButtonTrailingButton`

Supported platforms: Android.

Type: React.[Element](https://www.typescriptlang.org/docs/handbook/jsx.html#function-component)<[SplitButtonTrailingButtonProps](https://docs.expo.dev/versions/latest/sdk/ui/jetpack-compose/splitbuttonlayout.md#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`.

SplitButtonTrailingButtonProps

### `checked`

Supported platforms: Android.

Type: `boolean`

Whether the trailing button is checked. This usually matches the menu's `expanded` state.

### `children`

Supported platforms: Android.

Type: [ReactNode](https://reactnative.dev/docs/react-node)

Content to display inside the button, usually an icon.

### `colors`

Supported platforms: Android.

Optional • Type: [ButtonColors](https://docs.expo.dev/versions/v58.0.0/sdk/ui/jetpack-compose/button.md#buttoncolors)

Colors for the button. Unset colors use `ButtonDefaults.buttonColors()`.

### `enabled`

Supported platforms: Android.

Optional • Type: `boolean` • Default: `true`

Whether the button is enabled for user interaction.

### `modifiers`

Supported platforms: Android.

Optional • Type: `ModifierConfig[]`

Modifiers for the component.

### `onCheckedChange`

Supported platforms: Android.

Optional • Type: `(checked: boolean) => void`

Callback that is called with the new checked state when the button is clicked.

## Types

### `ButtonColors`

Supported platforms: Android.

Colors for button elements.

| Property | Type | Description |
| --- | --- | --- |
| containerColor(optional) | [ColorValue](https://reactnative.dev/docs/colors) | - |
| contentColor(optional) | [ColorValue](https://reactnative.dev/docs/colors) | - |
| disabledContainerColor(optional) | [ColorValue](https://reactnative.dev/docs/colors) | - |
| disabledContentColor(optional) | [ColorValue](https://reactnative.dev/docs/colors) | - |
