select-react-sr

0.1.4 • Public • Published

select-react-sr

select-react-sr is a library for easy-to-use and customizable select elements to integrate into your web projects.

Features

  • Easy customization: You can easily customize the appearance and behavior of the select element according to your needs.
  • Lightweight: We keep the library lightweight for fast loading and optimal performance.
  • Fully accessible: We strive to adhere to accessibility best practices to ensure your component is usable by everyone.

Installation

Install the library using npm:

    
npm install select-react-sr
    
  

Install the library using Yarn:

    
yarn add select-react-sr
    
  

USAGE

import { Select } from 'select-react-sr';
import { useState } from 'react';

function MyComponent() {
  const [selectedValue, setSelectedValue] = useState("");
  
  const selectStyles = {
    containerStyle: { borderRadius: "5px" },
    valueContainerStyle: { backgroundColor: "transparent" },
    arrowContainerStyle: { color: "black" },
    dropdownMenuStyle: { backgroundColor: "pink" },
    dropdownMenuOptionStyle: { padding: "8px" },
  };

  const handleSelectChange = (selectedValue) => {
    setSelectedValue(selectedValue);
  };

  const optionsValues = [
    { value: "Oleg", title: "Oleg" },
    { value: "Sol", title: "Sol" },
    { value: "Max", title: "Max" },
  ];

  return (
    <div>
      <Select
        title={`Name`}
        value={selectedValue}
        options={optionsValues}
        onChange={handleSelectChange}
        {...selectStyles}
      />
    </div>
  );
}

License

https://github.com/sol1217/simple-react-select/blob/main/LICENSE

Package Sidebar

Install

npm i select-react-sr

Weekly Downloads

0

Version

0.1.4

License

MIT

Unpacked Size

42.9 kB

Total Files

17

Last publish

Collaborators

  • sol999