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

@commercetools-uikit/primary-action-dropdown

Package Overview
Dependencies
Maintainers
0
Versions
980
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools-uikit/primary-action-dropdown

A dropdown component with any number of action, where the first action of the dropdown can be triggered without opening the dropdown itself.

  • 0.0.0-canary-20241119103253
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-35.26%
Maintainers
0
Weekly downloads
 
Created
Source

PrimaryActionDropdown

Description

A PrimaryActionDropdown is a dropdown with any number of action whereas the first action of the dropdown can be triggered without opening the dropdown itself.

The primary action, rendered as the head of the dropdown, is always the first non-disabled <Option />. If all <Option />s are disabled, the head of the dropdown will be disabled.

Installation

yarn add @commercetools-uikit/primary-action-dropdown
npm --save install @commercetools-uikit/primary-action-dropdown

Additionally install the peer dependencies (if not present)

yarn add react
npm --save install react

Usage

import PrimaryActionDropdown, {
  Option,
} from '@commercetools-uikit/primary-action-dropdown';
import { PlusBoldIcon } from '@commercetools-uikit/icons';

const Example = () => (
  <PrimaryActionDropdown>
    <Option iconLeft={<PlusBoldIcon />} onClick={() => {}}>
      Primary option
    </Option>
    <Option onClick={() => {}}>Another option</Option>
    <Option isDisabled={true} onClick={() => {}}>
      Even another option
    </Option>
  </PrimaryActionDropdown>
);

export default Example;

PrimaryActionDropdown

Properties

PropsTypeRequiredDefaultDescription
childrenArray: ReactElement[]Any React element.

Option

Properties

PropsTypeRequiredDefaultDescription
onClickFunction
See signature.
Event handler triggers whenever the option is clicked.
isDisabledbooleanfalseDisables the option within the dropdown. If all options are disabled the dropdown will be disabled.
childrenstringAny string which serves as the label.
iconLeftReactNodeAny React node.

Signatures

Signature onClick
() => void

Keywords

FAQs

Package last updated on 19 Nov 2024

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