Skip to main content

Buttons

MNSingleButton

import MNSingleButton from '@/components/ui/buttons/MNSingleButton';

Props

PropTypeDefaultDescription
textstringRequiredText label to display inside the button.
iconstringRequiredIonicons icon name to display.
onPress() => void-Function triggered on button press (not called if isLoading is true).
colorstringWHITE_COLORColor of the icon and text.
bgColorstringPRIMARY_COLORBackground color of the button.
isLoadingbooleanfalseIf true, shows a loading spinner instead of the text.
fullWidthbooleantrueIf true, button will expand to full width.
iconPosition'left' | 'right''left'Determines if the icon appears on the left or right of the text.

Basic Usage

<MNSingleButton
text="Submit"
icon="checkmark-outline"
onPress={() => console.log('Submitted')}
/>

Button with Right-Aligned Icon

<MNSingleButton
text="Next"
icon="arrow-forward-outline"
iconPosition="right"
onPress={() => console.log('Next pressed')}
/>

Loading State Button

<MNSingleButton
text="Saving"
icon="save-outline"
isLoading={true}
/>

Non-Full Width Button with Custom Colors

<MNSingleButton
text="Cancel"
icon="close-outline"
bgColor="#ccc"
color="#333"
fullWidth={false}
onPress={() => console.log('Cancelled')}
/>

MNCompoundButton Component

A dual-button component used to display two side-by-side action buttons with customizable text, icon, colors, and actions.


Import

import MNCompoundButton from '@/components/ui/buttons/MNCompoundButton';

Props

PropTypeRequiredDefaultDescription
firstButtonTextstringLabel for the first button.
firstButtonIconstringIcon name for the first button (Ionicons).
firstButtonColorstringText/icon color for the first button.
firstButtonBgColorstringBackground color for the first button.
firstButtonCloseAction() => voidCallback when the first button is pressed.
secondButtonTextstringLabel for the second button.
secondButtonIconstringIcon name for the second button (Ionicons).
secondButtonColorstring-Text/icon color for the second button.
secondButtonBgColorstringBackground color for the second button.
secondButtonCloseAction() => voidCallback when the second button is pressed.

Usage Examples

<MNCompoundButton
firstButtonText="Cancel"
firstButtonIcon="close-outline"
firstButtonColor="#fff"
firstButtonBgColor="#999"
firstButtonCloseAction={() => console.log('Cancelled')}
secondButtonText="Confirm"
secondButtonIcon="checkmark-outline"
secondButtonColor="#fff"
secondButtonBgColor="#4CAF50"
secondButtonCloseAction={() => console.log('Confirmed')}
/>

MNDropdown Component

A reusable dropdown component in React Native using a bottom sheet for option selection.


Import

import MNDropdown from '@/components/ui/buttons/MNDropdown';

Props

PropTypeRequiredDefaultDescription
labelstringLabel text displayed on the dropdown button.
optionsstring[]List of selectable options.
valuestringCurrently selected value.
onChange(value: string) => voidCallback fired when an option is selected.
iconstringIonicons icon name shown on the button (e.g., chevron-down).
activebooleantrueEnables or disables the dropdown interaction.

Usage Examples

 <MNDropdown
label={'I am dropdown button'}
options={['Option 01', 'Option 02']}
value={'Option 01'}
onChange={function (value: string): void {
alert('Selected Option: ' + value);
}}
icon={'chevron-down'}
/>

NOTE: All example can be founded in buttons.tsx