import { FormSwitch } from './FormSwitch';
import { Meta, Story, Canvas, ArgTypes, Source } from '@storybook/addon-docs/blocks';
import * as FormSwitchStories from './FormSwitch.stories';

<Meta
  title="Forms/Atoms/Switch"
  of={FormSwitchStories}
  parameters={{ viewMode: 'docs'}}
/>

# Form Switch

<Source language="ts" code={`import { FormSwitch } from '@batoanng/mui-components';`} />

The `FormSwitch` provides a hook-form integration for the switch field.

## Simple use case

<Canvas of={FormSwitchStories.Default} />

## With validation rules

Any violation of `rules` will show in a standard error message under the component.

<Canvas of={FormSwitchStories.Rules} />


## Arguments

<ArgTypes of={FormSwitch} />
