1.0.8 • Published 11 months ago

@cyril-vtn/select v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

Installation

npm install @cyril-vtn/select

Usage

import Select from "@cyril-vtn/select";

const options = [
  { value: "option1", label: "Option 1" },
  { value: "option2", label: "Option 2" },
  { value: "option3", label: "Option 3" },
];

const App = () => {
  const [selectedOption, setSelectedOption] = useState(null);

  return (
    <div>
      <Select
        label="Select an option"
        options={options}
        value={selectedOption}
        onChange={(e) => setSelectedOption(e.target.value)}
      />
    </div>
  );
};

export default App;

Props

PropTypeDefaultDescription
labelstringSelectThe label of the select component.
optionsarray[]The options to display in the select component.
valuestringnullThe value of the selected option.
onChangefunction() => {}The function to call when the selected option changes.
namestringnullThe name of the select component.

License

This project is licensed under the MIT License.

Author

Cyril Votion

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago