Skip to content

Switch - fix docs page #3705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 29, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions src/components/switch/switch.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,13 @@
"snippet": [
"function Example(props) {",
" const [value, setValue] = useState(false$1);",
" return (",
" <div>",
" <Switch value={value$2} onValueChange={setValue$3}/>",
" </div>",
" );",
" return <Switch margin-20 value={value$2} onValueChange={setValue$3}/>;",
"}"
],
"docs": {
"hero": {
"title": "Switch",
"description": "Use switches to toggle a single option on or off, activate or deactivate, and switch between two different states. \n\nConsider using switch instead of checkbox, when appropriate. \nConsider using switch instead of radio buttons if there’s only two options to choose from. ",
"description": "Use switches to toggle a single option on or off, activate or deactivate, and switch between two different states. \n\nConsider using switch instead of checkbox, when appropriate. \nConsider using switch instead of radio buttons if there’s only two options to choose from. ",
"type": "hero",
"layout": "horizontal",
"content": [
Expand Down Expand Up @@ -125,6 +121,7 @@
"description": "",
"content": [
{
"background": "#20303C",
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_style_light.png"
}
]
Expand All @@ -149,6 +146,7 @@
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_state_default_on.png"
},
{
"background": "#20303C",
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_state_light_on.png"
}
]
Expand All @@ -161,6 +159,7 @@
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_state_default_off.png"
},
{
"background": "#20303C",
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_state_light_off.png"
}
]
Expand All @@ -173,6 +172,7 @@
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_state_default_disabledOn.png"
},
{
"background": "#20303C",
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_state_light_disabledOn.png"
}
]
Expand All @@ -185,6 +185,7 @@
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_state_default_disabledOff.png"
},
{
"background": "#20303C",
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_state_light_disabledOff.png"
}
]
Expand All @@ -197,17 +198,21 @@
"type": "list",
"items": [
{
"title": "",
"description": "markdown: \n### Size \nOne size ",
"title": "Size",
"description": "Currently, only one size available for the ToggleSwitch.",
"content": [
{
"value": "https://embed.figma.com/design/xFjvYNkGTmYTGYMLrmz9Ir/Docs-Assets?node-id=52-7459&embed-host=share"
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Switch/switch_overview_spec_size.png"
}
]
},
{
"title": "",
"description": "markdown: \n### Haptic \nHaptic is played on tap.\nHaptic preset: [impactMedium]",
"title": "Colors",
"description": "markdown:<b>ON</b><br>Background color: $backgroundPrimaryHeavy<br>Knob color: $iconDefaultLight<br><b>OFF</b><br>Background color: $backgroundNeutralHeavy<br>Knob color: $iconDefaultLight<br><b>Disabled</b><br>Background color: $backgroundDisabled<br>Knob color: $iconDefaultLight"
},
{
"title": "Haptic ",
"description": "Haptic is played on tap. Haptic preset: [impactMedium]",
"content": [
{
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components Docs/Switch/switch_overview_spec_haptic.png"
Expand Down