forked from coreui/coreui-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSwitch.stories.js
53 lines (47 loc) · 1.33 KB
/
CSwitch.stories.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from 'react';
import CSwitch from '../src/switch/CSwitch'
import CCard from '../src/card/CCard'
import CCardBody from '../src/card/CCardBody'
import CCol from '../src/grid/CCol'
import { boolean, number, text, select } from '@storybook/addon-knobs';
export default {
title: 'CSwitch'
};
export const basic = () => {
const size = select('Size', ['', 'lg', 'sm'], '', 'Other')
const shape = select('Shape', ['', 'pill', 'square'], '', 'Other')
const variant = select('Variant', ['', '3d', 'opposite', 'outline'], '', 'Other')
const colorOptions = [
"",
"primary",
"secondary",
"success",
"warning",
"danger",
"info",
"light",
"dark",
]
const color = select('Color', colorOptions, 'primary', 'Other')
const labelOn = text('Label on', '', 'Other')
const labelOff = text('Label off', '', 'Other')
const checked = boolean('Checked', true, 'Other')
return <>
<CCol lg="6" md="8" xs="12">
<CCard>
<CCardBody>
<CSwitch
size={size}
shape={shape}
variant={variant}
color={color}
value={color}
labelOn={labelOn}
labelOff={labelOff}
checked={checked}
/>
</CCardBody>
</CCard>
</CCol>
</>
}