@chameleon-ds/switch

2.0.1 • Public • Published

Chameleon Switch

import { html } from "@open-wc/demoing-storybook";
import { withKnobs, text, boolean } from "@open-wc/demoing-storybook";
import "./chameleon-switch.js";

export default {
  title: "Components|Form Elements/Switch",
  component: "chameleon-switch",
  decorators: [withKnobs],
  options: { selectedPanel: "storybookjs/docs/panel" },
};

Properties

Property Name Type(s) Default Value Description
label String "" The switch's label
checked Boolean false If the switch is checked
readonly Boolean false If the switch's value is readonly
value String "" The switch's current value

Examples

Default

export const Default = () => {
  const label = text("Label", "");
  const checked = boolean("Checked", true);
  const readonly = boolean("Read Only", false);

  return html`
    <chameleon-switch
      label="${label}"
      ?checked="${checked}"
      ?readonly="${readonly}"
    ></chameleon-switch>
  `;
};

/@chameleon-ds/switch/

    Package Sidebar

    Install

    npm i @chameleon-ds/switch

    Weekly Downloads

    0

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    19.2 kB

    Total Files

    7

    Last publish

    Collaborators

    • chuckhousley
    • zemptime
    • mandymichel
    • olerk16
    • tfreiner
    • kewalter
    • ryuhhnn