# selectoc

> Composant Select inspiré du Select de Ant Design

Latest version **0.2.0** (published 2023-11-04) · 0 weekly downloads

## Install

```sh
npm install selectoc
pnpm add selectoc
yarn add selectoc
bun add selectoc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-11-04 |
| First published | 2023-10-31 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mehdi |
| Maintainers | npmdotcom |
| Keywords | openclassroom, select, p14 |

## Links

- npm: https://www.npmjs.com/package/selectoc
- npm.io page: https://npm.io/package/selectoc

## Dependencies (3)

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) ^0.2.0
- [@fortawesome/fontawesome-svg-core](https://npm.io/package/@fortawesome/fontawesome-svg-core.md) ^6.4.2
- [@fortawesome/free-solid-svg-icons](https://npm.io/package/@fortawesome/free-solid-svg-icons.md) ^6.4.2

## Recent versions

- 0.2.0 (latest) — 2023-11-04
- 0.1.9 — 2023-11-02
- 0.1.8 — 2023-11-02
- 0.1.7 — 2023-11-02
- 0.1.6 — 2023-11-01
- 0.1.5 — 2023-11-01
- 0.1.4 — 2023-10-31
- 0.1.3 — 2023-10-31
- 0.1.2 — 2023-10-31
- 0.1.1 — 2023-10-31
- 0.1.0 — 2023-10-31

## README

# Selectoc 📦

**Selectoc** is a dropdown component inspired by the Ant Design's Select component. It allows you to swiftly and efficiently set up an option selector for your React applications.

## Prerequisites 📝

- **Node.js:** v16.14.2 (or higher)
- **Recommended Text Editor:** VS Code, Sublime Text, etc.

## Installation 🛠

To install Selectoc, use npm:

```bash
npm install selectoc
```

## Usage 🚀

Integrate the Selectoc component into your React application:

```jsx
import React from "react";
import Selectoc from "selectoc";

function App() {
  const options = [
    { value: "option1", label: "Option 1" },
    { value: "option2", label: "Option 2" },
    // ... Other options
  ];

  const handleChange = (value) => {
    console.log("Selected value:", value);
  };

  return (
    <div>
      <Selectoc
        options={options}
        onChange={handleChange}
        defaultValue="option1"
      />
    </div>
  );
}

export default App;
```

## Props

**options:** An array of objects representing the options. Each object should have value and label keys.

**onChange:** A callback function that's called when the selected value changes.

**defaultValue:** The default value of the selector.

**_Example_**
Given the options array:

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

And using the Selectoc component like:

```jsx
<Selectoc options={options} onChange={handleChange} defaultValue="option1" />
```

You'll see "Option 1" displayed by default, and the handleChange function will be called each time the user selects a new option.

**_License_**
**MIT**

**Author:** Mehdi R.

---
_Source: https://npm.io/package/selectoc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
