Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@acusti/dropdown
Advanced tools
Readme
Dropdown
is a React component that renders a menu-like UI with a trigger
that the user clicks to disclose a dropdown positioned below the trigger.
The body of the dropdown can include any DOM, and many dropdowns can be
combined to form a multi-item menu, like the system menu in the top toolbar
of macOS.
The three primary design goals for the existence of this component:
<button>
trigger, pass in a single
child element with the body of the dropdowndata-ukt-item
boolean to mark dropdown items, or use
data-ukt-value="foo"
to specify that an element is a dropdown item
and the value of that item at the same time (otherwise, the value is
the text content of the dropdown item element)See the storybook docs and demo to get a feel for what it can do.
npm install @acusti/dropdown
# or
yarn add @acusti/dropdown
This is the type signature for the props you can pass to Dropdown
. The
unique features provided by the component are called out and explained
above the corresponding prop via JSDoc comments:
type Props = {
/**
* Boolean indicating if the user can submit a value not already in the
* dropdown.
*/
allowCreate?: boolean;
/**
* Boolean indicating if the user can submit an empty value (i.e. clear
* the value). Defaults to true.
*/
allowEmpty?: boolean;
/**
* Can take a single React element or exactly two renderable children.
*/
className?: string;
disabled?: boolean;
hasItems?: boolean;
isOpenOnMount?: boolean;
isSearchable?: boolean;
keepOpenOnSubmit?: boolean;
label?: string;
/**
* Only usable in conjunction with {isSearchable: true}.
* Used as search input’s name.
*/
name?: string;
onClick?: (event: React.MouseEvent<HTMLElement>) => unknown;
onClose?: () => unknown;
onMouseDown?: (event: React.MouseEvent<HTMLElement>) => unknown;
onMouseUp?: (event: React.MouseEvent<HTMLElement>) => unknown;
onOpen?: () => unknown;
onSubmitItem?: (payload: Item) => void;
/**
* Only usable in conjunction with {isSearchable: true}.
* Used as search input’s placeholder.
*/
placeholder?: string;
style?: React.CSSProperties;
/**
* Only usable in conjunction with {isSearchable: true}.
* Used as search input’s tabIndex.
*/
tabIndex?: number;
/**
* Used as search input’s value if props.isSearchable === true
* Used to determine if value has changed to avoid triggering onSubmitItem if not
*/
value?: string;
};
FAQs
React component that renders a dropdown with a trigger and supports searching, keyboard access, and more
The npm package @acusti/dropdown receives a total of 269 weekly downloads. As such, @acusti/dropdown popularity was classified as not popular.
We found that @acusti/dropdown demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.