mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
feat(checkbox): add readonly prop
This commit is contained in:
parent
b0be811d8b
commit
eb0ad4106d
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
export let id = Math.random();
|
||||
export let labelText = '';
|
||||
export let name = '';
|
||||
export let readonly = false;
|
||||
export let hideLabel = false;
|
||||
export let title = '';
|
||||
export let style = undefined;
|
||||
|
@ -39,7 +40,8 @@
|
|||
{disabled}
|
||||
{checked}
|
||||
{name}
|
||||
{id} />
|
||||
{id}
|
||||
{readonly} />
|
||||
<label class={cx('--checkbox-label')} for={id} title={title || undefined}>
|
||||
<span class={cx('--checkbox-label-text', hideLabel && '--visually-hidden')}>{labelText}</span>
|
||||
</label>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue