rn-easy-action-sheet
v1.0.0
Published
Easy to create the action sheet in react native with deep customiztion
Downloads
1
Maintainers
Readme
rn-easy-action-sheet
Action sheet component for react native, it works on iOS and Android.
Content
Installation
- 1.Run
npm i rn-easy-action-sheet --save
ORyarn add rn-easy-action-sheet
- 2.
import ActionSheet from 'rn-easy-action-sheet'
Getting started
Add rn-easy-action-sheet
to your js file.
import ActionSheet from 'rn-easy-action-sheet'
Inside your component's render method, use CheckBox:
const Data = [
{
title: 'Happy',
icon: <Image source={Happy} style={{
width: 30,
height: 30,
marginRight: 10
}} />,
CallBackFn: (data) => {
console.log("====== Return title =======",data)
}
},
{
title: 'Good',
icon: <Image source={Good} style={{
width: 30,
height: 30,
marginRight: 10
}} />,
CallBackFn: (data) => {
console.log("===== Return title ========",data)
}
},
{
title: 'Joy',
icon: <Icon name="iconName" style={{
width: 30,
height: 30,
marginRight: 10
}} />,
CallBackFn: (data) => {
console.log("===== Return title =======",data)
}
},
{
title: 'Drank',
icon: <Image source={Drank} style={{
width: 30,
height: 30,
marginRight: 10
}} />,
CallBackFn: (data) => {
console.log("==== Return title ========",data)
}
},
];
<ActionSheet
toggle={() => setOpenActionSheet(!openActionSheet)}
data={Data}
modalVisible={openActionSheet}
darkMode={true}
cancelButtonName="Done"
CancelButtonStyle={{
color: 'red'
}}
/>
Then you can use it like this:
More Usage:
API
Props | Type | Optional | Default | Description ----------------- | -------- | -------- | ----------- | ----------- toggle | PropTypes.func | false | | Show hide action sheet cancelButtonName | PropTypes.string | false | Cancel | Cancel button text CancelButtonStyle | PropTypes.object | true | | - contactTitleContainer | PropTypes.object | true | | - darkMode | PropTypes.bool | true | false | Switch action sheet to light and dark mode data | PropTypes.array.isRequired |false | | Array
Contribution
Issues are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.
Pull requests are welcome. If you want to change API or making something big better to create issue and discuss it first.
MIT Licensed