mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +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 id = Math.random();
|
||||||
export let labelText = '';
|
export let labelText = '';
|
||||||
export let name = '';
|
export let name = '';
|
||||||
|
export let readonly = false;
|
||||||
export let hideLabel = false;
|
export let hideLabel = false;
|
||||||
export let title = '';
|
export let title = '';
|
||||||
export let style = undefined;
|
export let style = undefined;
|
||||||
|
@ -39,7 +40,8 @@
|
||||||
{disabled}
|
{disabled}
|
||||||
{checked}
|
{checked}
|
||||||
{name}
|
{name}
|
||||||
{id} />
|
{id}
|
||||||
|
{readonly} />
|
||||||
<label class={cx('--checkbox-label')} for={id} title={title || undefined}>
|
<label class={cx('--checkbox-label')} for={id} title={title || undefined}>
|
||||||
<span class={cx('--checkbox-label-text', hideLabel && '--visually-hidden')}>{labelText}</span>
|
<span class={cx('--checkbox-label-text', hideLabel && '--visually-hidden')}>{labelText}</span>
|
||||||
</label>
|
</label>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue