New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@chameleon-ds/button

Package Overview
Dependencies
Maintainers
6
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chameleon-ds/button

Chameleon button

2.0.1
latest
Source
npm
Version published
Weekly downloads
3
Maintainers
6
Weekly downloads
 
Created
Source

Chameleon Button

import { html, svg } from "lit-html";
import "./chameleon-button.js";

export default {
  title: "Components|Buttons/Button",
  component: "chameleon-button",
  options: { selectedPanel: "storybookjs/docs/panel" },
};

Properties

Property NameType(s)Default ValueDescription
disabledBooleanfalseWhether or not the button is disabled
loadingBooleanfalseWhen true, a loading spinner will display
themeString"primary"The theme of the button ("primary", "secondary", or "text")
icon-leftBooleanfalseWhen true, will display a left icon
icon-rightBooleanfalseWhen true, will display a right icon
icon-onlyBooleanfalseWhen true, will display only an icon
hrefStringnullThe link href
targetString"_top"The link target

Examples

Default

export const Default = () => html`<chameleon-button>Login</chameleon-button>`;

Secondary Theme

export const SecondaryTheme = () =>
  html`<chameleon-button theme="secondary">Login</chameleon-button>`;

Text Theme

export const TextTheme = () =>
  html`<chameleon-button theme="text">Login</chameleon-button>`;

Text with Icon

const heartIconLeft = svg`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-heart" slot="icon-left"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>`;

export const TextWithIcon = () =>
  html`<chameleon-button theme="text" icon-left
    >${heartIconLeft} Love</chameleon-button
  >`;

Icon Only

const heartIcon = svg`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-heart" slot="icon-left"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>`;

export const IconOnly = () =>
  html`<chameleon-button theme="text" icon-only
    >${heartIcon}</chameleon-button
  >`;

FAQs

Package last updated on 22 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts