Skip to content

Releases: metonym/svelte-toggle

v4.0.1

15 Mar 20:11
Compare
Choose a tag to compare

Fixes

  • include exports field in package.json

v4.0.0

29 May 18:08
Compare
Choose a tag to compare

Breaking Changes

  • drop bundled ES/UMD support
  • set type="module" in package.json

Fixes

  • colocate type definitions with source files

v3.1.0

31 Oct 17:58
Compare
Choose a tag to compare

Features

  • complete JSDoc/TypeScript prop descriptions

Fixes

  • ToggleCore.d.ts props should extend button HTML attributes

Documentation

  • add disabled toggle example

v3.0.3

31 Oct 17:46
Compare
Choose a tag to compare

This is a patch release that refreshes documentation published to NPM/Yarn etc.

Documentation

  • simplify fully controlled example
  • add pnpm install command

v3.0.2

27 Aug 21:09
Compare
Choose a tag to compare

This is a patch release that refreshes documentation published to NPM/Yarn etc.

Documentation

  • simplify Basic/Switch Descriptors examples in README
  • add two way binding example

v3.0.1

02 Aug 15:03
Compare
Choose a tag to compare

This is a patch release that refreshes documentation published to NPM/Yarn etc.

Documentation

  • separate default value column in API props

v3.0.0

05 Dec 21:05
Compare
Choose a tag to compare

Breaking Changes

  • remove forwarded mouse, keydown events from Toggle
  • TypeScript: use SvelteComponentTyped instead of SvelteComponent (requires Svelte >=v3.31)

v2.0.0

29 Nov 13:57
Compare
Choose a tag to compare

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

17 Nov 14:00
Compare
Choose a tag to compare

Features

  • Add TypeScript definitions

v1.0.0

26 Aug 23:42
Compare
Choose a tag to compare

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 to true) (#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 default Toggle to use ToggleCore

Breaking Changes

  • on / off props are optional and must be truthy to use named slots