akveo / react-native-ui-kitten

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/react-native-ui-kitten/
MIT License
10.33k stars 955 forks source link

Toggle-able Button in ButtonGroup #1369

Open Rc85 opened 3 years ago

Rc85 commented 3 years ago

🚀 Feature Proposal

Allow Button props to override ButtonGroup props or implement selectedIndex and onSelect/onPress into ButtonGroup and the button of the selected index will automatically become filled.

Motivation

This would enable a toggle-able ButtonGroup component.

https://material-ui.com/components/toggle-button/

Example

<ButtonGroup appearance='outline'>
  <Button appearance={selectedIndex === 0 ? 'filled' : 'outlined'}>Selected</Button>
  <Button appearance={selectedIndex === 1 ? 'filled' : 'outlined'}>Not Selected</Button>
</ButtonGroup>
nabeelvalley commented 3 years ago

I also think this would be a great addition, so any props on the inner Button's shouldn't be overwritten by the the props on the ButtonGroup