Replies: 2 comments 2 replies
-
Neither checkbox nor switch support help text. I'd be open to a PR to add these using the same convention as In the meantime, the best I can recommend is adding it directly into the label. <sl-switch>
Switch
<span class="help-text">This is some more info</span>
</sl-switch>
<style>
.help-text {
display: block;
margin-top: .125em;
font-size: smaller;
color: var(--sl-color-neutral-500);
}
</style> |
Beta Was this translation helpful? Give feedback.
-
Happy to open a PR! Though Switch is a slightly tricker case than Input because Switch is wrapped in a How would you feel if I separated Switch's |
Beta Was this translation helpful? Give feedback.
-
Switch doesn't allow setting
aria-describedby
I have a switch that calls for a description below that is meant to add context. I'm able to add the description to Switch by wrapping it. But I'm unable to associate the description in the accessibility tree with Switch's underlying
<input>
. If Switch acceptedariaDescribedby
as a property, I could associate the two.I'm open to a workaround as well! The wrinkle, in my case, is that I'm wrapping Switch instead of extending it for reasons that are a little complicated. Otherwise, I could select the
<input>
and setaria-describedby
programatically. Any other ideas?Beta Was this translation helpful? Give feedback.
All reactions