Socket
Socket
Sign inDemoInstall

@blaze-react/select

Package Overview
Dependencies
Maintainers
8
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blaze-react/select

The select component represents an input that provides a menu of options


Version published
Weekly downloads
255
decreased by-40.14%
Maintainers
8
Weekly downloads
 
Created
Source

Description

The select component represents an input that provides a menu of options.

Usage

  • Array of options
const options = ["London", "Paris", "Munich"];

<Select
  label="Select a city"
  options={options}
  onChange={({ event, value }) => {}}
  required
/>;
  • Multidimensional Array of options
const options = [
  ["08001", "Barcelona"],
  ["17006", "Madrid"],
];

<Select
  label="Select label"
  selected="08001"
  options={options}
  onChange={({ event, value }) => {}}
/>;
  • Array of objects
const arrayOfObjects = [
  {
    id: 1,
    username: "Oscar",
    age: 26,
  },
  {
    id: 2,
    username: "Ismael",
    age: 23,
  },
];

<Select
  label="Select user"
  selected="1"
  options={options}
  keys={["id", "username"]}
  onChange={({ event, value }) => {}}
/>;
  • Disabling some options
const disabled = ["17006"]


<Select label="Disabled option" onChange={({ event, value }) => {}} options={options} disabled={disabled} />
  • By default is disabled if none options
<Select label="Disabled" onChange={({ event, value }) => {}} options={[]} />

API

Select can receive a number of props as follow:
NAMETYPEDEFAULT
labelString''
requiredBooleanfalse
optionsArray[]
selectedString''
keysArray[]
onChangeFunction() => {}
disabledArray[]
defaultTextValueStringPlease Choose...

FAQs

Package last updated on 06 Oct 2021

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