Files
coder/site/components/Button/LoadingButton.stories.tsx
T
Bryan 94f71feeba refactor: Add storybook + initial story (#118)
This hooks up `storybook`, which the front-end team has enjoyed using in the v1 codebase - it makes it quick and easy to view and test components in isolation.

The `<LoadingButton />` has a simple story added now, so if you run `yarn storybook`, you can preview it in various states:

![2022-01-31 19 24 24](https://user-images.githubusercontent.com/88213859/151908656-27dac0a8-9c6e-4353-ad25-3eafee979bd4.gif)

This will be helpful as we bring more front-end devs to help build v2 out.
2022-02-04 08:36:58 -08:00

27 lines
645 B
TypeScript

import { Story } from "@storybook/react"
import React from "react"
import { LoadingButton, LoadingButtonProps } from "./LoadingButton"
export default {
title: "Button/LoadingButton",
component: LoadingButton,
argTypes: {
loading: { control: { type: "boolean" } },
children: { control: "text", defaultValue: "Create workspace" },
},
}
const Template: Story<LoadingButtonProps> = (args) => <LoadingButton {...args} />
export const Loading = Template.bind({})
Loading.args = {
variant: "contained",
loading: true,
}
export const NotLoading = Template.bind({})
NotLoading.args = {
variant: "contained",
loading: false,
}