mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33:02 +00:00
feat(radio-button-group): add hideLegend prop
This commit is contained in:
parent
38048d1fc0
commit
52cd7afbf3
1 changed files with 4 additions and 1 deletions
|
@ -11,6 +11,9 @@
|
||||||
/** Specify the legend text */
|
/** Specify the legend text */
|
||||||
export let legendText = "";
|
export let legendText = "";
|
||||||
|
|
||||||
|
/** Set to `true` to visually hide the legend */
|
||||||
|
export let hideLegend = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the label position
|
* Specify the label position
|
||||||
* @type {"right" | "left"}
|
* @type {"right" | "left"}
|
||||||
|
@ -84,7 +87,7 @@
|
||||||
disabled="{disabled}"
|
disabled="{disabled}"
|
||||||
>
|
>
|
||||||
{#if legendText || $$slots.legendText}
|
{#if legendText || $$slots.legendText}
|
||||||
<legend class:bx--label="{true}">
|
<legend class:bx--label="{true}" class:bx--visually-hidden="{hideLegend}">
|
||||||
<slot name="legendText">{legendText}</slot>
|
<slot name="legendText">{legendText}</slot>
|
||||||
</legend>
|
</legend>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue