New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

action-view

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

action-view

action-view

latest
npmnpm
Version
0.0.42
Version published
Weekly downloads
48
1500%
Maintainers
1
Weekly downloads
 
Created
Source

Usage

Define an array of action configurations outside your React component and pass it into the ActionView component.

Features

  • Flexible onClick handlers:
    Each action supports synchronous or asynchronous onClick handlers, enabling API calls, animations, or other side effects.

  • Customizable layout:
    Control the orientation with the layout prop. Options: "vertical" or "horizontal".

  • Overflow control:
    Use the maxVisible prop to specify how many buttons are shown before the rest overflow into a dropdown menu.

Example

import { ActionView } from "action-view";
import type { ClickAction } from "action-view";

const actions: ClickAction[] = [
  {
    label: "Edit",
    onClick: async () => {
      console.log("Edit clicked");
      await new Promise((res) => setTimeout(res, 500)); // async example
    },
    type: "primary",
  },
  {
    label: "Delete",
    onClick: () => {
      console.log("Delete clicked");
    },
    danger: true,
  },
];

function Example() {
  return (
    <ActionView
      actions={actions}
      maxVisible={2} // Show only 2 buttons, rest in overflow dropdown
    />
  );
}

Keywords

action-buttons

FAQs

Package last updated on 07 Sep 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