Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@commercetools-uikit/primary-action-dropdown
Advanced tools
A dropdown component with any number of action, where the first action of the dropdown can be triggered without opening the dropdown itself.
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.
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
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;
Props | Type | Required | Default | Description |
---|---|---|---|---|
children | Array: ReactElement[] | ✅ | Any React element. |
Props | Type | Required | Default | Description |
---|---|---|---|---|
onClick | Function See signature. | ✅ | Event handler triggers whenever the option is clicked. | |
isDisabled | boolean | false | Disables the option within the dropdown. If all options are disabled the dropdown will be disabled. | |
children | string | ✅ | Any string which serves as the label. | |
iconLeft | ReactNode | ✅ | Any React node. |
onClick
() => void
FAQs
A dropdown component with any number of action, where the first action of the dropdown can be triggered without opening the dropdown itself.
The npm package @commercetools-uikit/primary-action-dropdown receives a total of 3,147 weekly downloads. As such, @commercetools-uikit/primary-action-dropdown popularity was classified as popular.
We found that @commercetools-uikit/primary-action-dropdown demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.