-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathkswitch.vue
107 lines (96 loc) · 2.54 KB
/
kswitch.vue
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<template>
<DocsPageTemplate apiDocs>
<DocsPageSection
title="Overview"
anchor="#overview"
>
<DocsShow>
<KSwitch
v-model="exampleData"
label="Things are happening"
/>
<p>Value: {{ exampleData }}</p>
</DocsShow>
<p>
A switch toggle is used to select and execute an action instantly, in real time. A switch is
toggled successfully when the switch thumb slides to the other side of the track upon click
or press.
</p>
<p>
For selections that require a confirmation to execute and are housed in a form, use
<DocsLibraryLink component="KCheckbox" /> component instead.
</p>
</DocsPageSection>
<DocsPageSection
title="Usage"
anchor="#usage"
>
<p>Use a switch for the following:</p>
<ul>
<li>When an instant response is required without final confirmation</li>
<li>Actions that do not need a formal review</li>
<li>Selections that offer an on/off decision</li>
</ul>
</DocsPageSection>
<DocsPageSection
title="Specifications"
anchor="#specifications"
>
<ul>
<li>
Thumb ON color:
<DocsInternalLink
code
text="brand.primary.v_500"
href="/colors#brand-primary-v_500"
/>
</li>
<li>
Track ON color:
<DocsInternalLink
code
text="brand.primary.v_200"
href="/colors#brand-primary-v_200"
/>
</li>
<li>
Thumb OFF color:
<DocsInternalLink
code
text="palette.grey.v_100"
href="/colors#palette-grey-v_100"
/>
</li>
<li>
Track OFF color:
<DocsInternalLink
code
text="palette.grey.v_300"
href="/colors#palette-grey-v_300"
/>
</li>
</ul>
</DocsPageSection>
<DocsPageSection
title="Guidelines"
anchor="#guidelines"
>
<ul>
<li>Align a switch with the container margin</li>
<li>Align a switch to the right of the text label</li>
<li>Stack swithes vertically in lists</li>
<li>Switch text labels Labels should concisely describe the action to be executed</li>
</ul>
</DocsPageSection>
</DocsPageTemplate>
</template>
<script>
export default {
data() {
return {
exampleData: true,
};
},
};
</script>
<style lang="scss" scoped></style>