Skip to content

code-bryan/react-selector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-Select

An easy way to build customizable selects - dropdowns using ReactJS

How to install

npm install @bryancode/react-select

or

yarn add @bryancode/react-select

Simple use example

import { Select, OptionInterface } from '@bryancode/react-select';
import '@bryancode/react-select/dist/index.css'
import { useState } from 'react';

const options: OptionInterface[] = [
  {
    value: 1,
    content: 'Monica',
  },
  {
    value: 2,
    content: 'Raul',
  }
];

export default function Home() {
  const [select, setSelect] = useState<OptionInterface>();

  return (
    <div>
      <Select
        options={options}
        value={select?.value}
        placeholder='Select Example'
        onChange={(value) => setSelect(value)}
      />
    </div>
  );
}

Dependencies

  • react-icons
  • classnames

About

A customizable generic select built for React JS

Resources

Stars

Watchers

Forks

Packages

No packages published