Skip to main content

MenuButton

List-item style button for menu items and settings rows. Supports a leading icon, title, value display, and trailing icon.

Basic Usage

import { MenuButton } from '@multinaire/ui';

<MenuButton
leading="Setting2"
title="Settings"
trailing="ArrowRight2"
onPress={() => {}}
/>

Props

PropTypeDefaultDescription
titlestringButton label text
leadingIconNameIcon name displayed at the leading (left) end of the button
trailingIconNameIcon name displayed at the trailing (right) end of the button
valuestringValue string rendered between the title and the trailing icon. Useful for showing a current selection
flexnumberFlex grow value
widthDimensionValueFixed width of the button
heightDimensionValuetheme mediumFixed height of the button. Defaults to the theme's medium height
marginSpacingPropsOuter margin
isLoadingbooleanfalseShow a loading animation and disable the button
testIDstringtitleTest identifier for UI automation. Defaults to the title value
onPress() => voidPress handler. When omitted the button renders in a disabled (dimmed) state

Examples

Settings Menu

<Container gap={8}>
<MenuButton
leading="User"
title="Profile"
trailing="ArrowRight2"
onPress={() => navigation.navigate('Profile')}
/>
<MenuButton
leading="Notification"
title="Notifications"
trailing="ArrowRight2"
onPress={() => navigation.navigate('Notifications')}
/>
<MenuButton
leading="Shield"
title="Privacy"
trailing="ArrowRight2"
onPress={() => navigation.navigate('Privacy')}
/>
</Container>

With Value

<MenuButton
leading="Global"
title="Language"
value="English"
trailing="ArrowRight2"
onPress={() => openLanguagePicker()}
/>

Destructive Action

<MenuButton
leading="Logout"
title="Sign Out"
onPress={() => signOut()}
/>