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

@spectrum-web-components/action-group

Package Overview
Dependencies
Maintainers
5
Versions
279
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/action-group

`sp-action-group` delivers a set of action buttons in horizontal or vertical orientation while ensuring the appropriate spacing between those buttons. The `compact` attribute merges these buttons so that they are visually joined to clarify their relations

  • 0.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.3K
increased by5.64%
Maintainers
5
Weekly downloads
 
Created
Source

Description

sp-action-group delivers a set of action buttons in horizontal or vertical orientation while ensuring the appropriate spacing between those buttons. The compact attribute merges these buttons so that they are visually joined to clarify their relationship to each other and their distance from other buttons/groups.

Usage

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

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

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

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

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

import { ActionGroup } from '@spectrum-web-components/action-group';

Horizontal

<sp-action-group>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Button 1
    </sp-action-button>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Longer Button 2
    </sp-action-button>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Short 3
    </sp-action-button>
</sp-action-group>
<br />
<sp-action-group compact>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Button 1
    </sp-action-button>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Longer Button 2
    </sp-action-button>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Short 3
    </sp-action-button>
</sp-action-group>
<br />
<sp-action-group>
    <sp-action-button quiet label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
    <sp-action-button quiet label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
    <sp-action-button quiet label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
</sp-action-group>
<br />
<sp-action-group compact>
    <sp-action-button label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
    <sp-action-button label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
    <sp-action-button label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
</sp-action-group>

Vertical

<div style="display: flex; justify-content: space-around;">
    <sp-action-group vertical>
        <sp-action-button>
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
            Button 1
        </sp-action-button>
        <sp-action-button>
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
            Longer Button 2
        </sp-action-button>
        <sp-action-button>
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
            Short 3
        </sp-action-button>
    </sp-action-group>
    <sp-action-group vertical compact>
        <sp-action-button>
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
            Button 1
        </sp-action-button>
        <sp-action-button>
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
            Longer Button 2
        </sp-action-button>
        <sp-action-button>
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
            Short 3
        </sp-action-button>
    </sp-action-group>
    <sp-action-group vertical>
        <sp-action-button quiet label="Zoom in">
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        </sp-action-button>
        <sp-action-button quiet label="Zoom in">
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        </sp-action-button>
        <sp-action-button quiet label="Zoom in">
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        </sp-action-button>
    </sp-action-group>
    <sp-action-group compact vertical>
        <sp-action-button label="Zoom in">
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        </sp-action-button>
        <sp-action-button label="Zoom in">
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        </sp-action-button>
        <sp-action-button label="Zoom in">
            <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        </sp-action-button>
    </sp-action-group>
</div>

Justified

<sp-action-group justified>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Button 1
    </sp-action-button>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Longer Button 2
    </sp-action-button>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Short 3
    </sp-action-button>
</sp-action-group>
<br />
<sp-action-group justified compact>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Button 1
    </sp-action-button>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Longer Button 2
    </sp-action-button>
    <sp-action-button>
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
        Short 3
    </sp-action-button>
</sp-action-group>
<br />
<sp-action-group justified>
    <sp-action-button quiet label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
    <sp-action-button quiet label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
    <sp-action-button quiet label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
</sp-action-group>
<br />
<sp-action-group compact justified>
    <sp-action-button label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
    <sp-action-button label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
    <sp-action-button label="Zoom in">
        <sp-icon slot="icon" size="xs" name="ui:Magnifier"></sp-icon>
    </sp-action-button>
</sp-action-group>

Keywords

FAQs

Package last updated on 12 Oct 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

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