2.0.1 • Published 4 years ago

@chameleon-ds/toast v2.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
4 years ago

Chameleon Toast

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

export default {
  title: "Components|Overlays/Toast",
  component: "chameleon-toast",
  decorators: [withKnobs],
  options: { selectedPanel: "storybookjs/knobs/panel" },
};

Properties

Property NameType(s)Default ValueDescription
colorStringcolorThe toast's color
showCloseableBooleantrueWhether or not the toast can be closed
backgroundColorStringnullThe toast's background color

Examples

Default

export const Default = () => {
  const color = text("Color", "");
  const backgroundColor = text("Background Color", "");
  const showCloseable = boolean("Show", true);
  const imageUrl = text(
    "Image Url",
    "https://media.istockphoto.com/photos/chocolate-chip-cookie-isolated-picture-id517109442?k=6&m=517109442&s=612x612&w=0&h=NvQ5y8ENWZvpr84vEFWmxUgV2rCgtOGEsjJXa3IYsZ4="
  );
  const toastText = text(
    "Text",
    "This website uses cookies to remember you and improve your experience. By using our site, you accept our use of cookies."
  );

  return html`
    <chameleon-toast
      color="${color}"
      backgroundColor="${backgroundColor}"
      ?showCloseable="${showCloseable}"
    >
      <span slot="toast-text">${toastText}</span>
      <img slot="close-icon" src="${imageUrl}" />
    </chameleon-toast>
  `;
};
2.0.1

4 years ago

2.0.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago