Socket
Socket
Sign inDemoInstall

@bearei/react-dropdown

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bearei/react-dropdown

Base dropdown components that support React and React native


Version published
Maintainers
1
Created
Source

react-dropdown

Base dropdown components that support React and React native

Installation

yarn add @bearei/react-dropdown --save

Parameters

Dropdown options
NameTypeRequiredDescription
visiblebooleanDropdown visible state
eventReact.MouseEvent React.TouchEvent GestureResponderEventTriggers an event when a dropdown option changes
Dropdown
NameTypeRequiredDescription
visiblebooleanDropdown visible state
defaultVisiblebooleanThe default visible state for the dropdown
menuMenuPropsDropdown menu props -- Menu
disabledbooleanWhether or not to disable the dropdown
loadingbooleanWhether or not the dropdown is loading
onVisible(options: DropdownOptions) => voidThis function is called when the dropdown visible state changes
onClose(options: DropdownOptions) => voidThis function is called when the dropdown is closed
onClick(e: React.MouseEvent) => voidThis function is called when dropdown is clicked
onTouchEnd(e: React.TouchEvent) => voidThis function is called when the dropdown is pressed
onPress(e: GestureResponderEvent) => voidThis function is called when the dropdown is pressed -- react native
renderMain(props: DropdownMainProps) => ReactNodeRender the dropdown main
renderContainer(props: props: DropdownContainerProps) => ReactNodeRender the dropdown container

Use

import React from 'React';
import ReactDOM from 'react-dom';
import Dropdown from '@bearei/react-dropdown';

const dropdown = (
  <Dropdown
    renderMain={({ ...props }) => <div {...props}>"dropdown"</div>}
    renderContainer={({ id, content }) => (
      <div data-id={id} tabIndex={1}>
        {content}
      </div>
    )}
  />
);

ReactDOM.render(dropdown, container);

Keywords

FAQs

Package last updated on 10 Feb 2023

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