Skip to content

Instantly share code, notes, and snippets.

@JoshK2
Last active October 24, 2019 15:38
Show Gist options
  • Save JoshK2/4d4da7f694ac6a2258cec1c308611171 to your computer and use it in GitHub Desktop.
Save JoshK2/4d4da7f694ac6a2258cec1c308611171 to your computer and use it in GitHub Desktop.
Create React typescript components library - Storybook - stories file examples
import React from 'react';
import { action } from '@storybook/addon-actions';
import Button from '../src/components/Button';
export default {
title: 'Button',
};
export const text = () => <Button text="Hello Button" onClick={action('clicked')} />;
export const disableOption = () => (
<Button onClick={action('clicked')} disable>
Hello Button
</Button>
);
export const emoji = () => (
<Button onClick={action('clicked')}>
<span role="img" aria-label="so cool">
πŸ˜€ 😎 πŸ‘ πŸ’―
</span>
</Button>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment