@chameleon-ds/checkbox

2.0.1 • Public • Published

Chameleon Checkbox

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

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

Properties

Property Name Type(s) Default Value Description
label String "" The checkbox's label
name String "cha-checkbox" The checkbox's form name
checked Boolean false A Boolean which, if true, indicates that the checkbox is selected
value String "" The checkbox's current value
readonly Boolean false A Boolean attribute which, if true, indicates that the checkbox cannot be edited
disabled Boolean false The checkbox's enabled/disabled status
invalid Boolean false Invalid boolean to allow validity access from higher level form errors
required boolean false A Boolean to indicate the input is required

Examples

Default

export const Default = () => {
  const label = text("Label", "");
  const checked = boolean("Checked", true);
  const disabled = boolean("Disabled", false);
  const invalid = boolean("Invalid", false);

  return html`
    <chameleon-checkbox
      label="${label}"
      ?checked="${checked}"
      ?disabled="${disabled}"
      ?invalid="${invalid}"
    ></chameleon-checkbox>
  `;
};

Readme

Keywords

none

Package Sidebar

Install

npm i @chameleon-ds/checkbox

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

22.2 kB

Total Files

7

Last publish

Collaborators

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