Created
March 30, 2020 16:17
-
-
Save artyorsh/f4521fb53ade5dad5a6c880f7785e971 to your computer and use it in GitHub Desktop.
Usage is pretty straightforward, but I'll leave this here for anyone else looking for a quick copy / paste:
export default ({}: Props) => {
const [selectedIndex, setSelectedIndex] = React.useState(0);
return (
<ButtonSwitch
onSelect={(index) => setSelectedIndex(index)}
selectedIndex={selectedIndex}
fullWidth>
<Button>OPTION 0</Button>
<Button>OPTION 1</Button>
<Button>OPTION 2</Button>
</ButtonSwitch>
);
};
This yields the following:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey do you have an example of how to use this?