dancormier / react-native-swipeout

iOS-style swipeout buttons behind component
MIT License
2.62k stars 649 forks source link

Adding icon in swipelist instead of text #246

Closed webdevsyd closed 6 years ago

webdevsyd commented 6 years ago

Hi @dancormier

I would like to ask if how can I add an icon in the swipe button, the design that was given to me uses an icon instead of text. Hope you can help me. Thank you!

Baraa-bi commented 6 years ago

hey @webdevsyd

you could do so like the following

i am using react-native-elements to get the Icon class


swipeoutBtns : [
            {
                component:<Icon raised 
                color='white'
                containerStyle={{backgroundColor: '#FF5722'}}
                name='delete'/>,
                onPress:()=>this.setState({delete:true})
            }
]
silentcloud commented 6 years ago

@webdevsyd https://github.com/dancormier/react-native-swipeout#button-props component prop