mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
parent
614e6eb087
commit
b1b7de12dd
1 changed files with 8 additions and 3 deletions
|
@ -24,6 +24,9 @@
|
||||||
/** Specify the label text */
|
/** Specify the label text */
|
||||||
export let labelText = "";
|
export let labelText = "";
|
||||||
|
|
||||||
|
/** Set to `true` to visually hide the label text */
|
||||||
|
export let hideLabel = false;
|
||||||
|
|
||||||
/** Set an id for the input element */
|
/** Set an id for the input element */
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
@ -76,9 +79,11 @@
|
||||||
for="{id}"
|
for="{id}"
|
||||||
class:bx--toggle-input__label="{true}"
|
class:bx--toggle-input__label="{true}"
|
||||||
>
|
>
|
||||||
|
<span class:bx--visually-hidden="{hideLabel}">
|
||||||
<slot name="labelText">
|
<slot name="labelText">
|
||||||
{labelText}
|
{labelText}
|
||||||
</slot>
|
</slot>
|
||||||
|
</span>
|
||||||
<span class:bx--toggle__switch="{true}">
|
<span class:bx--toggle__switch="{true}">
|
||||||
<span aria-hidden="true" class:bx--toggle__text--off="{true}">
|
<span aria-hidden="true" class:bx--toggle__text--off="{true}">
|
||||||
<slot name="labelA">
|
<slot name="labelA">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue