Closed quantuminformation closed 4 years ago
Agreed. Open to PRs in this regard.
~Also, another idea would be to make the component "styleless" by default, leaving styling up to the consumer.~
Thinking back on it, the original intent was to make this component "styleless." If you're after the classic "switch" look, I'd suggest looking at something like svelte-switch.
it didnt work for me and its too much bloat from react
@quantuminformation in which case I'm open to exploring the classic UI
Thinking aloud here... I see the benefit of having a classic UI look while also giving the freedom to style it however way you want it. Going even further, the Toggle could be "renderless" (i.e. a slot that passes state as props)
Toggle
base export (unstyled)ToggleSwitch
(classic UI)nice one thx, I think people like me are just lazy and want it to look good and you to do the thinking
@quantuminformation svelte-toggle
has been redesigned and released in v1.0.0. It incorporates changes that address several issues you've raised. Let me know if you encounter any issues.
The demo contains example use cases.
PR #5
switchColor
, toggledColor
, untoggledColor
) (#3)hideLabel
to true
) (#4)label
text is changed from "Toggle label" to "Label"Toggle
switch sizeToggleCore
which instruments the accessibility aspects (this component is "renderless" in that it does not have any styles or markup)
refactor default Toggle
to use ToggleCore
Breaking Changes
on
/ off
props are optional and must be truthy to use named slotsWow you are fast man! great work!
seen
might be better for users to see it like