feat(radio-button-group): add hideLegend prop

This commit is contained in:
Eric Liu 2022-02-26 11:06:33 -08:00
commit 52cd7afbf3

View file

@ -11,6 +11,9 @@
/** Specify the legend text */
export let legendText = "";
/** Set to `true` to visually hide the legend */
export let hideLegend = false;
/**
* Specify the label position
* @type {"right" | "left"}
@ -84,7 +87,7 @@
disabled="{disabled}"
>
{#if legendText || $$slots.legendText}
<legend class:bx--label="{true}">
<legend class:bx--label="{true}" class:bx--visually-hidden="{hideLegend}">
<slot name="legendText">{legendText}</slot>
</legend>
{/if}