rsnext/examples/with-storybook/stories/button.stories.js
Jose Manuel Casani Guerra f226a376b1
refactor: update example of storybook (#17936)
## Change

- Update package versions
- Replace @storybook/addons, @storybook/addon-actions to @storybook/addon-essentials
- Replace examples of button, the action function is legacy: https://storybook.js.org/docs/react/essentials/actions#advanced--legacy-usage
2020-11-11 23:14:42 +00:00

25 lines
544 B
JavaScript

import React from 'react'
import { Button } from '@storybook/react/demo'
export default {
title: 'Button',
argTypes: { onClick: { action: 'clicked' } },
}
const TemplateWithText = (args) => <Button {...args}>Hello Button</Button>
const TemplateWithEmoji = (args) => (
<Button {...args}>
<span role="img" aria-label="so cool">
😀 😎 👍 💯
</span>
</Button>
)
export const withText = TemplateWithText.bind({})
withText.args = {}
export const withSomeEmoji = TemplateWithEmoji.bind({})
withSomeEmoji.args = {}