Files
baserow/web-frontend/stories/ButtonFloating.stories.js
Davide Silvestri 331910f62e fix(database): anchor the floating add row button to the view (#6222)
* fix(database): anchor the floating add row button to the view

Position the + button absolute to the gallery, grid and timeline view
containers instead of fixed to the viewport, so it stays inside the view
when a side panel narrows it.

* chore(storybook): replace fixed with absolute in ButtonFloating story
2026-09-30 16:30:54 +02:00

96 lines
2.0 KiB
JavaScript

import ButtonFloating from '@baserow/modules/core/components/ButtonFloating'
export default {
title: 'Baserow/Buttons/ButtonFloating',
component: ButtonFloating,
tags: ['autodocs'],
argTypes: {
icon: {
control: 'text',
description: 'The icon class name to display',
},
type: {
control: 'select',
options: ['primary', 'secondary'],
description: 'The color variant',
},
size: {
control: 'select',
options: ['regular', 'small'],
description: 'The size of the button',
},
position: {
control: 'select',
options: ['relative', 'absolute'],
description: 'Positioning strategy',
},
loading: {
control: 'boolean',
description: 'Show loading spinner',
},
disabled: {
control: 'boolean',
description: 'Disable the button',
},
},
args: {
icon: 'iconoir-plus',
type: 'primary',
size: 'regular',
position: 'relative',
loading: false,
disabled: false,
},
}
export const Default = {
render: (args) => ({
components: { ButtonFloating },
setup() {
return { args }
},
template: '<ButtonFloating v-bind="args" />',
}),
}
export const Secondary = {
args: {
type: 'secondary',
icon: 'iconoir-edit-pencil',
},
render: (args) => ({
components: { ButtonFloating },
setup() {
return { args }
},
template: '<ButtonFloating v-bind="args" />',
}),
}
export const Small = {
args: {
size: 'small',
icon: 'iconoir-search',
},
render: (args) => ({
components: { ButtonFloating },
setup() {
return { args }
},
template: '<ButtonFloating v-bind="args" />',
}),
}
export const States = {
render: () => ({
components: { ButtonFloating },
template: `
<div style="display: flex; gap: 10px;">
<ButtonFloating icon="iconoir-plus" />
<ButtonFloating icon="iconoir-plus" loading />
<ButtonFloating icon="iconoir-plus" disabled />
</div>
`,
}),
}