react-styled-toggle
Version:
Customizable toggle button
45 lines (44 loc) • 1.1 kB
JavaScript
import Toggle from '../index';
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
const meta = {
title: 'Toggle button',
component: Toggle,
parameters: {
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
layout: 'centered',
},
tags: ['autodocs'],
argTypes: { onChange: { action: 'onChange' } },
};
export default meta;
export const Standard = {
args: {},
};
export const Controlled = {
args: { disabled: false, checked: true },
};
export const CustomizedColors = {
args: {
backgroundColorChecked: 'papayawhip',
backgroundColorUnchecked: 'aquamarine',
},
};
export const CustomizedSize = {
args: {
width: 40,
height: 20,
sliderWidth: 12,
sliderHeight: 12,
translate: 19,
},
};
export const LabelRight = {
args: {
labelRight: 'Label',
},
};
export const LabelLeft = {
args: {
labelLeft: 'Label',
},
};