feat(combo-box): add hideLabel prop (#2153)

This commit is contained in:
Nick Wing 2025-04-18 12:27:14 -05:00 committed by GitHub
commit 436dea47e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 50 additions and 1 deletions

View file

@ -46,6 +46,9 @@
/** Specify the title text of the combobox */
export let titleText = "";
/** Set to `true` to visually hide the label text */
export let hideLabel = false;
/** Specify the placeholder text */
export let placeholder = "";
@ -226,7 +229,12 @@
<div class:bx--list-box__wrapper={true}>
{#if titleText || $$slots.titleText}
<label for={id} class:bx--label={true} class:bx--label--disabled={disabled}>
<label
for={id}
class:bx--label={true}
class:bx--label--disabled={disabled}
class:bx--visually-hidden={hideLabel}
>
<slot name="titleText">
{titleText}
</slot>