New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@chameleon-ds/switch

Package Overview
Dependencies
Maintainers
6
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chameleon-ds/switch

Chameleon switch

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
4
-66.67%
Maintainers
6
Weekly downloads
 
Created
Source

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 NameType(s)Default ValueDescription
labelString""The switch's label
checkedBooleanfalseIf the switch is checked
readonlyBooleanfalseIf the switch's value is readonly
valueString""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>
  `;
};

FAQs

Package last updated on 22 Jun 2020

Related posts