JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q30830F
  • License MIT

A React Dropdown

Package Exports

  • gosu-dropdown
  • gosu-dropdown/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gosu-dropdown) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Dropdown

Gosu React Dropdown is a simple React dropdown component

Installation

If you're using npm, in the command prompt run:

npm install gosu-dropdown --save

If you're using yarn, run:

yarn add gosu-dropdown

Usage

To use the component, first import Dropdown into your file:

import Dropdown from "gosu-dropdown";
const options = [
  { key: '1', value: <div>๐Ÿ‡บ๐Ÿ‡ธ English</div>, label: <div>๐Ÿ‡บ๐Ÿ‡ธ</div>  },
  { key: '2', value: <div>๐Ÿ‡ต๐Ÿ‡ฑ Polski</div>, label: <div>๐Ÿ‡ต๐Ÿ‡ฑ</div>  },
  { key: '3', value: <div>๐Ÿ‡บ๐Ÿ‡ฆ ะฃะบั€ะฐั—ะฝัŒัะบะพัŽ</div>, label: <div>๐Ÿ‡บ๐Ÿ‡ฆ</div>  },
]

<Dropdown
  defaultSelectedKey="1"
  listPlacement="bottomRight"
  options={options} />

Props

Property Type Default Description
options Array [] {key: string, value: string, label?: string }
onChange function undefined
listPlacement string bottomCenter bottomCenter, bottomLeft, bottomRight
caretColor styles undefined #000
placeholder styles undefined 'Select option'
defaultSelectedKey number string Any key from options
isOpen boolean undefined Needs for development, if you want add custom style
styleRoot styles undefined Custom style for Root
styleTrigger styles undefined Custom style for Trigger
styleOption styles undefined Custom style for Option
styleList styles undefined Custom style for List