Releases: metonym/svelte-toggle
Releases · metonym/svelte-toggle
v4.0.1
v4.0.0
v3.1.0
v3.0.3
v3.0.2
v3.0.1
v3.0.0
v2.0.0
Breaking Changes
-
Dispatched "change" event has been removed; use
on:toggle
instead<Toggle on:toggle={(e) => { console.log(e.detail); // true | false }} />
-
Named "on" and "off" slots have been removed; override the default slot and destructure the
toggled
prop<Toggle let:toggled> <span style="margin-left: .5rem">{toggled ? "Yes" : "No"}</span> </Toggle>
-
TypeScript users will need Svelte version 3.30 or greater
v1.1.0
v1.0.0
svelte-toggle
has been redesigned.
PR #5
- refactor default toggle styles to conform to the classic "switch" UI for boolean states (#2)
- allow Toggle UI colors to be customized (
switchColor
,toggledColor
,untoggledColor
) (#3) - allow label to be visually hidden (set
hideLabel
totrue
) (#4) - default
label
text is changed from "Toggle label" to "Label" - make on/off labels optional (by default they're undefined)
- add small variant for
Toggle
switch size - extract core component logic into standalone
ToggleCore
which instruments the accessibility aspects (this component is "renderless" in that it does not have any styles or markup)
refactor defaultToggle
to useToggleCore
Breaking Changes
on
/off
props are optional and must be truthy to use named slots