Skip to main content

ActionSheet

An ActionSheet is a dynamic component in our library that offers users a menu of options or actions within an application. It typically appears as a modal or popover, presenting a list of choices relevant to the current context or user interaction. ActionSheets enable users to make decisions or initiate specific actions conveniently, enhancing usability and efficiency. With customizable styling and flexible configurations, our ActionSheet component seamlessly integrates into diverse interfaces, empowering users with intuitive navigation and interaction.

Usage

Basic usage

import React, {useState} from 'react';
import {ActionSheet} from 'rn-inkpad';

const MyComponent = () => {
const [isVisible, setIsVisible] = useState(false);

return <ActionSheet setVisible={setIsVisible} visible={isVisible} />;
};

Props

NameTypeRequiredDescription
visiblebooleanYESShow/Hide ActionSheet
setVisible(visible: boolean) => voidYESFunction that controls the visibility of the component
actionsAction[]NOArray of actions to show
cancelTextstringNOText for cancel button
descriptionstringNODescription text for your ActionSheet
showCancelButtonbooleanNOShow cancel button
showIconOnIosbooleanNOShow action icon on iOS
showCloseButtonbooleanNOShow close button
themeActionSheetThemeNOCustomize your ActionSheet theme.
titlestringNOTitle for your ActionSheet.

Action props

NameTypeRequiredDescription
textstringYESAction button text.
iconstringNOIcon to show in the action.
iconColorstringNOPersonalized icon color.
textStyleStyleProp<TextStyle>NOPersonalized styles for your text button.
onPress() => voidYESFunction that is executed when the button is pressed.

ActionSheetTheme props

NameTypeDefault iOSDefault Android
appearance'light' | 'dark'SystemSystem
backgroundColorstringLight: '#F4F4F4' Dark: '#171717'Light: '#FFFFFF' Dark: '#171717'
buttonColorstringLight: '#FFFFFF' Dark: '#242625'Light: '#FFFFFF' Dark: '#171717'
closeBackgroundColorstringLight: '#ECECEC' Dark: '#1C1E1D'Light: '#ECECEC' Dark: '#1C1E1D'
closeIconColorstringLight: '#767779' Dark: '#959394'Light: '#767779' Dark: '#959394'
separatorColorstringLight: '#E4E4E4' Dark: '#343434'N/A
textColorstringLight: '#0A0A0A' Dark: '#FFFFFF'Light: '#0A0A0A' Dark: '#FFFFFF'
theme'cupertino' | 'material'SystemSystem

Usage with props

import React, {useState} from 'react';
import {ActionSheet} from 'rn-inkpad';

const MyComponent = () => {
const [isVisible, setIsVisible] = useState(false);

return (
<ActionSheet
actions={[
{
text: 'Change profile picture',
icon: 'ear',
onPress: () => console.log('Change profile picture'),
},
{
text: 'View profile picture',
icon: 'eye',
onPress: () => console.log('View profile picture'),
},
{
text: 'View status',
icon: 'bandage',
onPress: () => console.log('View status'),
},
]}
setVisible={setIsVisible}
description="Select any action below to proceed"
title="Select an action"
visible={isVisible}
/>
);
};

Examples

iOS

Android