Skip to content

Commit 4fe6fe9

Browse files
committed
docs: switch
1 parent d294988 commit 4fe6fe9

File tree

1 file changed

+10
-68
lines changed

1 file changed

+10
-68
lines changed
Lines changed: 10 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Switch
22

3-
::tabs{:titles='["Usage", "API", "Source Code"]' class="mt-8"}
3+
::tabs{:titles='["Usage", "API"]' class="mt-8"}
44

55
#tab-1
66

@@ -18,31 +18,15 @@ Switch base component without a label.
1818

1919
<Showcase showcase-name="Switch/SwitchWithoutLabel">
2020

21-
::vue-only
22-
<<<../../../preview/nuxt/pages/showcases/Switch/SwitchWithoutLabel.vue
23-
::
24-
::react-only
25-
<<<../../../preview/next/pages/showcases/Switch/SwitchWithoutLabel.tsx
26-
::
27-
::qwik-only
2821
<<<../../../website/src/routes/showcases/Switch/SwitchWithoutLabel/index.tsx
29-
::
3022

3123
</Showcase>
3224

3325
## Switch with leading control
3426

3527
<Showcase showcase-name="Switch/SwitchLeading">
3628

37-
::vue-only
38-
<<<../../../preview/nuxt/pages/showcases/Switch/SwitchLeading.vue
39-
::
40-
::react-only
41-
<<<../../../preview/next/pages/showcases/Switch/SwitchLeading.tsx
42-
::
43-
::qwik-only
4429
<<<../../../website/src/routes/showcases/Switch/SwitchLeading/index.tsx
45-
::
4630

4731
</Showcase>
4832

@@ -52,71 +36,29 @@ Switch component with a label align on the left.
5236

5337
<Showcase showcase-name="Switch/SwitchTrailing">
5438

55-
::vue-only
56-
<<<../../../preview/nuxt/pages/showcases/Switch/SwitchTrailing.vue
57-
::
58-
::react-only
59-
<<<../../../preview/next/pages/showcases/Switch/SwitchTrailing.tsx
60-
::
61-
::qwik-only
6239
<<<../../../website/src/routes/showcases/Switch/SwitchTrailing/index.tsx
63-
::
6440

6541
</Showcase>
6642

43+
<!--
6744
## Accessibility notes
6845
6946
`SfSwitch` is built using the native `<input type="checkbox">` element. This means that has all of the same keyboard navigation and accessibility features as a native checkbox.
7047
7148
By default, it comes with a `role="switch"` attribute. This is useful for screen readers, which can announce the element as a switch.
49+
-->
7250

7351
## Playground
7452

75-
<Generate style="height: 380px" />
53+
<Generate class="playground" />
7654

7755
#tab-2
7856

7957
## Props
8058

81-
::vue-only
82-
| Prop name | Type | Default value | Possible values |
83-
| ------------ | ------------------------ | ------------- | -------------------------------------- |
84-
| `modelValue` | `boolean | string[]` | `undefined` | |
85-
| `value` | `string` | | |
86-
::
87-
88-
::react-only
89-
| Prop name | Type | Default value | Possible values |
90-
| ------------ | ------------------------ | ------------- | -------------------------------------- |
91-
| `value` | `string` | | |
92-
| `onChange` | `Function` | | |
93-
| `className` | `string` | | |
94-
::
95-
96-
::qwik-only
97-
| Prop name | Type | Default value | Possible values |
98-
| ------------ | ------------------------ | ------------- | -------------------------------------- |
99-
| `value` | `string` | | |
100-
| `onChange` | `Function` | | |
101-
| `className` | `string` | | |
102-
::
103-
104-
::vue-only
105-
106-
## Events
107-
108-
| Event name | Trigger |
109-
| ------------------- | ----------------------------- |
110-
| `update:modelValue` | triggers v-model update event |
111-
112-
::
113-
114-
#tab-3
115-
116-
::vue-only
117-
<<<../../../../packages/sfui/frameworks/vue/components/SfSwitch/SfSwitch.vue
118-
::
119-
::react-only
120-
<<<../../../../packages/sfui/frameworks/react/components/SfSwitch/SfSwitch.tsx
121-
::
122-
::
59+
| Prop name | Type | Default value | Possible values |
60+
| ----------- | ------------------------------------------------------------------ | ------------- | --------------- |
61+
| `ref?` | `Signal<Element>` | | |
62+
| `class?` | `string` | | |
63+
| `invalid?` | `boolean` | | |
64+
| `onChange$` | `PropFunction<(event: QwikChangeEvent<HTMLInputElement>) => void>` | | |

0 commit comments

Comments
 (0)