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
4
Versions
982
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools-uikit/primary-action-dropdown

#### Description

  • 10.18.4-canary.9
  • Source
  • npm
  • Socket score

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

Dropdowns: 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.

Usage
import PrimaryActionDropdown, {
  PrimaryActionDropdownOption,
} from '@commercetools-uikit/primary-action-dropdown';

<PrimaryActionDropdown>
  <PrimaryActionDropdownOption icon={<PlusBoldIcon />} onClick={() => {}}>
    Primary option
  </PrimaryActionDropdownOption>
  <PrimaryActionDropdownOption onClick={() => {}}>
    Another option
  </PrimaryActionDropdownOption>
  <PrimaryActionDropdownOption isDisabled={true} onClick={() => {}}>
    Even another option
  </PrimaryActionDropdownOption>
</PrimaryActionDropdown>;
Properties
PrimaryActionDropdown
PropsTypeRequiredValuesDefaultDescription
childrennode--The options of the dropdown (use the Option export from the component)
Option
PropsTypeRequiredValuesDefaultDescription
onClickfunc--What will trigger whenever the option is clicked
isDisabledbool--falseDisables the option within the dropdown. If all options are disabled the dropdown will be disabled
childrenstring--The label of the option
iconLeftnode--The icon left to the option (only for the primary option)
Invariants
  1. The PrimaryActionDropdown must have at least two Option elements as children
  • Use a PrimaryButton otherwise

Main Functions and use cases are:

  • Export button example: Default to export all but offer selected to be exported

FAQs

Package last updated on 31 Mar 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