mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23: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 */
|
||||
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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue