mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
fix(toggle): add missing hideLabel
prop (#1414)
* fix(toggle): add missing hideLabel prop * Run "yarn build:docs" * test(toggle): assert hideLabel prop * docs(toggle): add "Hidden label text" example
This commit is contained in:
parent
614e6eb087
commit
f4d12b805a
6 changed files with 34 additions and 4 deletions
|
@ -13494,6 +13494,18 @@
|
|||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "hideLabel",
|
||||
"kind": "let",
|
||||
"description": "Set to `true` to visually hide the label text",
|
||||
"type": "boolean",
|
||||
"value": "false",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"kind": "let",
|
||||
|
|
|
@ -23,6 +23,12 @@ components: ["Toggle", "ToggleSkeleton"]
|
|||
|
||||
<Toggle labelText="Push notifications" on:toggle={e => console.log(e.detail)} />
|
||||
|
||||
### Hidden label text
|
||||
|
||||
Set `hideLabel` to `true` to visually hide the label text. It's recommended to still specify `labelText` for screen reader accessibility.
|
||||
|
||||
<Toggle labelText="Push notifications" hideLabel />
|
||||
|
||||
### Custom labels
|
||||
|
||||
<Toggle labelText="Push notifications" labelA="No" labelB="Yes" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue