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

@asphalt-react/actionlist

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asphalt-react/actionlist

Actionlist

  • 2.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
58
increased by20.83%
Maintainers
0
Weekly downloads
 
Created
Source

Actionlist

npm

A component to display a list of actions. It consists of 2 components

  • Actionlist
  • Action

Actionlist provides accessibility features to operate on Actions. It also represents a bunch of provided Actions as a list. It supports 3 sizes: small (s), medium (m), large (l) where small is the default size.

An Action can function as any HTML or React element. Each action has an option to include an icon before the caption.

💡 Checkout @asphalt-react/iconpack for SVG wrapped React components.

Usage

import { Actionlist, Action } from "@asphalt-react/actionlist"
import { Link } from '@reach/router'

function App () {

    return (
        <Actionlist>
            <Action as="Link" asProps={{ to: "/document/edit" }}>
                Edit
            </Action>
            <Action actionable asProps={{ onClick: (event) => {} }}>
                Clone
            </Action>
            <Action>Share</Action>
            <Action>Delete</Action>
        </Actionlist>
    )
}

export default App;

Accessibility

  • Navigate among Actions using and arrow keys.
  • home and end focuses the first and last Actions respectively.
  • Select an action with the enter when in focus.
  • Select an actionable action(behave as button) with the enter or space when in focus.
  • Action and Actionlist takes care of necessary aria-* attributes.
  • Actionlist has role="menu" and actions have role="menuitem" attributes.
  • All the actions are organized as list items <li> in an unordered list <ul>.
  • You can also add other aria-attributes like aria-labelledby, aria-label to assist screen readers.

Props

children

List of actions to display inside Actionlist.

typerequireddefault
nodetrueN/A

Action

An action item in an Actionlist. It renders an <a> tag by default.

Props

children

Add caption for each Action.

typerequireddefault
nodefalseN/A

size

Size of Action. Accepts "s", "m", "l" for small, medium & large.

typerequireddefault
enumfalse"s"

qualifier

Renders an icon or text before the Action's caption. Accepts SVG.

Checkout @asphalt-react/iconpack for SVG icons

typerequireddefault
unionfalseN/A

qualifierEnd

Appends qualifier to the caption.

typerequireddefault
boolfalsefalse

danger

Applies danger styles to Action.

typerequireddefault
boolfalsefalse

actionable

Action behaves like a button.

typerequireddefault
boolfalsefalse

as

Use it to replace the default "anchor" tag with your router element. Accepts HTML element or a React component type.

typerequireddefault
elementTypefalseN/A

asProps

Accepts props & attributes for the link element. You can pass attributes like onKeyPress, href.

typerequireddefault
objectfalse{}

separator

Renders a separator before the Action, except for first one.

typerequireddefault
boolfalsefalse

Keywords

FAQs

Package last updated on 07 Jan 2025

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