-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add <sd-checkbox />
and <sd-checkboxgroup />
#71
Conversation
* @inheritdoc | ||
*/ | ||
public override render(): TemplateResult { | ||
return html` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like in a <sd-radiogroup>
the label or the slot content from the inner <sd-option>
is displayed, but in a <sd-checkboxgroup>
only slot content from the inner <sd-option>
is displayed. I think we should also be looking for the label
property of the <sd-option>
here?
<sd-field label="Radio Group">
<sd-radiogroup setting="radioSetting">
<sd-option label="Value 1" value="1">Other Value</sd-option>
<sd-option label="Value 2" value="2"></sd-option>
<sd-option label="Value 3" value="3"></sd-option>
</sd-radiogroup>
</sd-field>
<sd-field label="Checkbox Group">
<sd-checkboxgroup setting="checkboxGroupSetting">
<sd-option label="Value 1" value="1">Other Value</sd-option>
<sd-option label="Value 2" value="2"></sd-option>
<sd-option label="Value 3" value="3"></sd-option>
</sd-checkboxgroup>
</sd-field>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great call out; I've updated the following option-type elements to utilize their textContent
as the label
:
<sd-checkbox />
<sd-option />
<sd-radio />
<sd-switch />
This allows for the elements to be constructed in a similar manor to <select />
, for example
<sd-switch setting="isOn">On / Off</sd-switch>
Or in the context of a group:
<sd-checkboxgroup setting="options">
<sd-option value="1">One</sd-option>
<sd-option value="2">Two</sd-option>
</sd-checkboxgroup>
<sd-checkbox />
.<sd-checkboxgroup />
.<sd-switch />
.<sd-switch />
to be read fromtextContent
, rather thanlabel
.<sd-switch />
styles to align with<sd-checkbox />
.<sd-label />
from<sd-switch />
.