Last active
November 15, 2021 02:08
-
-
Save trooperandz/be1b0c4192906f705b2af75cbbca4ce4 to your computer and use it in GitHub Desktop.
React Native Storybook Button story file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// storybook/Button/index.stories.js | |
import React from 'react'; | |
import { storiesOf } from '@storybook/react-native'; | |
import { action } from '@storybook/addon-actions'; | |
import { text, select, boolean } from '@storybook/addon-knobs'; | |
import { CenterView } from '../CenterView'; | |
import { Button } from '.'; | |
const typeOptions = ['primary', 'secondary', 'tertiary']; | |
const iconOptions = ['none', 'search']; | |
storiesOf('components/Button', module) | |
.addDecorator(getStory => <CenterView>{getStory()}</CenterView>) | |
.add('Full demo', () => ( | |
<Button | |
iconType={select('icon', iconOptions, iconOptions[0])} | |
isLoading={boolean('isLoading', false)} | |
onPress={action('onPress executed')} | |
text={text('text', 'Submit')} | |
type={select('type', typeOptions, typeOptions[0])} | |
/> | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment