feat(slider): add hideLabel prop (#1777)

Closes #1682

Co-authored-by: siaikin <abc1310054026@outlook.com>
This commit is contained in:
Eric Liu 2023-07-23 12:04:39 -07:00 committed by GitHub
commit baff07e012
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 23 deletions

View file

@ -47,9 +47,15 @@
/** Set to `true` to indicate an invalid state */
export let invalid = false;
/** Specify the label text */
/**
* Specify the label text.
* Alternatively, use the "labelText" slot (e.g., <span slot="labelText">...</span>)
*/
export let labelText = "";
/** Set to `true` to visually hide the label text */
export let hideLabel = false;
/** Set a name for the slider element */
export let name = "";
@ -145,6 +151,7 @@
id="{labelId}"
class:bx--label="{true}"
class:bx--label--disabled="{disabled}"
class:bx--visually-hidden="{hideLabel}"
>
<slot name="labelText">
{labelText}