import { Meta, Story, ArgsTable, Canvas } from '@storybook/blocks';
import { getArgs } from '../../../tools/controlsHelper';
import { TableContentFromObject, FormOutput, CollapsibleJsonSnippet } from '../../../tools/docTools';
import StickyButtonPageScroll from '../StickyButtonPageScroll';
import * as StickyButtonPageScrollStories from './StickyButtonPageScroll.stories';

export const scrollTopSettings = {
    label: 'Label of the scroll to top button'
};

<Meta of={StickyButtonPageScrollStories} />

# StickyButtonPageScroll

<br />

## `StickyButtonPageScrolls` are used to scroll to top of the page when button is clicked.

<br />

### Default

<Canvas>
  <Story of={StickyButtonPageScrollStories.Default} />
</Canvas>

## Usage Example

<CollapsibleJsonSnippet summary="settingsData" code={getArgs(StickyButtonPageScroll.schema().form)} />

```jsx
import StickyButtonPageScroll from
    '@appdirect/sfb-theme-components/src/components/sticky-button-page-scroll/StickyButtonPageScroll';

<StickyButtonPageScroll settings={settingsData} />

```

## Props

<ArgsTable of={StickyButtonPageScroll} />

## Schema

### Form Settings

<table>
  <TableContentFromObject obj={scrollTopSettings} />
</table>

### Form Output

<FormOutput code={StickyButtonPageScroll.schema().form} />
