Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spectrum-web-components/action-button

Package Overview
Dependencies
Maintainers
5
Versions
253
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/action-button

An `<sp-action-button>` represents an action a user can take.

  • 0.0.2-alpha.1403
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.7K
decreased by-60.05%
Maintainers
5
Weekly downloads
 
Created
Source

Description

An <sp-action-button> represents an action a user can take.

Usage

See it on NPM! How big is this package in your project?

yarn add @spectrum-web-components/action-button

Import the side effectful registration of <sp-action-button> via:

import '@spectrum-web-components/action-button/sp-action-button.js';

When looking to leverage the ActionButton base class as a type and/or for extension purposes, do so via:

import { ActionButton } from '@spectrum-web-components/action-button';

Sizes

Small Medium Large Extra Large
<sp-button-group>
    <sp-action-button size="s">
        Do action
    </sp-action-button>
    <sp-action-button size="s" selected>
        Do action
    </sp-action-button>
    <sp-action-button size="s" disabled>
        Do action
    </sp-action-button>
</sp-button-group>
<sp-button-group>
    <sp-action-button size="m">
        Do action
    </sp-action-button>
    <sp-action-button size="m" selected>
        Do action
    </sp-action-button>
    <sp-action-button size="m" disabled>
        Do action
    </sp-action-button>
</sp-button-group>
<sp-button-group>
    <sp-action-button size="l">
        Do action
    </sp-action-button>
    <sp-action-button size="l" selected>
        Do action
    </sp-action-button>
    <sp-action-button size="l" disabled>
        Do action
    </sp-action-button>
</sp-button-group>
<sp-button-group>
    <sp-action-button size="xl">
        Do action
    </sp-action-button>
    <sp-action-button size="xl" selected>
        Do action
    </sp-action-button>
    <sp-action-button size="xl" disabled>
        Do action
    </sp-action-button>
</sp-button-group>

Variants

Action button with icon

<sp-action-button>
    <sp-icon-edit slot="icon"></sp-icon-edit>
    This is an action button
</sp-action-button>

Icon only action button

<sp-action-button label="Edit">
    <sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>

Emphasized action button

<sp-action-button label="Edit" emphasized selected>
    <sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>

Action button with hold affordance

The use of the hold-affordance attribute signifies that the <sp-action-button> in question will be delivered with a visual affordance that can be used to outline that additional related content can be acquired via further interaction with the button (e.g. a click, longpress, etc.).

<sp-action-group>
    <sp-action-button label="Edit" hold-affordance>
        <sp-icon-edit slot="icon"></sp-icon-edit>
    </sp-action-button>

    <sp-action-button hold-affordance quiet>
        <sp-icon-edit slot="icon"></sp-icon-edit>
    </sp-action-button>

    <sp-action-button hold-affordance selected>
        <sp-icon-edit slot="icon"></sp-icon-edit>
    </sp-action-button>
</sp-action-group>

Toggles

With the application of the toggles attribute, the button will self manage its selected property on click:

<sp-action-button toggles>
    Toggle button
</sp-action-button>

Keywords

FAQs

Package last updated on 13 Jan 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc