Skip to main content

ActionButton

Button with an icon and label, ideal for primary actions. Supports all ButtonType color variants.

Basic Usage

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

<ActionButton icon="Add" title="Add Item" onPress={() => {}} />

Props

PropTypeDefaultDescription
titlestringButton label text
iconIconNameIcon name displayed alongside the title
typeButtonType'primary'Color variant of the button. Defaults to 'primary'
reversedbooleanfalseWhen true, the icon is placed after the title instead of before
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

See ButtonType for all available type values.

Examples

Button Types

<ActionButton type="primary" icon="Add" title="Create" onPress={() => {}} />
<ActionButton type="secondary" icon="Edit2" title="Edit" onPress={() => {}} />
<ActionButton type="surface" icon="Eye" title="Preview" onPress={() => {}} />
<ActionButton type="success" icon="TickCircle" title="Confirm" onPress={() => {}} />
<ActionButton type="warning" icon="InfoCircle" title="Caution" onPress={() => {}} />
<ActionButton type="error" icon="Trash" title="Delete" onPress={() => {}} />

Reversed Icon Position

<ActionButton
icon="ArrowRight2"
title="Continue"
reversed
onPress={() => {}}
/>

Full Width

<ActionButton width="100%" icon="Send2" title="Submit" onPress={() => {}} />

Loading State

<ActionButton icon="DocumentUpload" title="Uploading..." isLoading onPress={() => {}} />

Migration

The 'destructive' type is deprecated. Replace it with 'error':

// Before
<ActionButton type="destructive" icon="Trash" title="Delete" />

// After
<ActionButton type="error" icon="Trash" title="Delete" />