bramw_baserow/web-frontend/stories/ButtonFloating.stories.mdx

86 lines
2.0 KiB
Plaintext

import { Meta, Story, Props, Canvas } from '@storybook/addon-docs/blocks'
import { config, withDesign } from 'storybook-addon-designs'
import ButtonFloating from '@baserow/modules/core/components/ButtonFloating'
<Meta
title="Baserow/Buttons/Floating"
component={ButtonFloating}
decorators={[withDesign]}
argTypes={{
size: {
control: {
type: 'select',
options: ['small', 'regular'],
},
defaultValue: 'regular',
},
type: {
control: {
type: 'select',
options: ['primary', 'secondary'],
},
defaultValue: 'primary',
},
icon: {
defaultValue: 'iconoir-plus',
},
loading: {
control: {
type: 'boolean',
options: [true, false],
},
defaultValue: false,
},
position: {
control: {
type: 'select',
options: ['relative', 'fixed'],
},
defaultValue: 'relative',
},
disabled: {
control: {
type: 'boolean',
options: [true, false],
},
defaultValue: false,
},
}}
/>
# Floating Button
export const Template = (args, { argTypes }) => ({
components: { ButtonFloating },
props: Object.keys(argTypes),
template: `<ButtonFloating v-bind="$props">${args.default}</ButtonFloating>`,
})
export const designConfig = {
type: 'figma',
url: 'https://www.figma.com/file/W7R2rQW7ohsZMeHRfEcPFW/Design-Library?type=design&node-id=1-85&mode=design&t=ZFKwI59cTYQROI8S-0',
}
<Canvas>
<Story
name="Default"
args={{ type: 'primary' }}
parameters={{
design: config(designConfig),
}}
>
{Template.bind({})}
</Story>
</Canvas>
## Example
```javascript
<ButtonFloating icon="iconoir-list"></ButtonFloating>
```
## Props
<Props of={FloatingButton} />