# chris_dropdown

> a simple dropdown for project need

Latest version **1.0.2** (published 2023-09-02) · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-09-02 |
| First published | 2023-08-22 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chardema |
| Maintainers | chardeman |

## Links

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

## Dependencies (8)

- [react](https://npm.io/package/react.md) ^18.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [web-vitals](https://npm.io/package/web-vitals.md) ^2.1.4
- [react-scripts](https://npm.io/package/react-scripts.md) 5.0.1
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.12.1
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^13.4.0
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^5.17.0
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^13.5.0

## Recent versions

- 1.0.2 (latest) — 2023-09-02
- 1.0.1 — 2023-09-01
- 1.0.0 — 2023-09-01
- 0.7.0 — 2023-08-25
- 0.6.1 — 2023-08-22
- 0.6.0 — 2023-08-22

## README

# ChrisDropdown

`chris_dropdown` is a custom React component for creating dropdown menus. It allows you to easily create and customize dropdowns in your React applications.

## Installation

To install `chris_dropdown`, you can use npm or yarn:

```
npm install chris_dropdown

or


yarn add chris_dropdown
```

## Usage

To use `ChrisDropdown` in your React application, you'll need to import it and then use it in your JSX code. Here's an example of how to do this:

```jsx
import { useState } from 'react';

import './App.css';
import ChrisDropdown from "./lib/components/ChrisDropdown";

const MyComponent = () => {
  const [department, setDepartment] = useState("Sales");

    const departments =[
        { value: 'Sales', label: 'Sales' },
        { value: 'Marketing', label: 'Marketing' },
        { value: 'Engineering', label: 'Engineering' },
        { value: 'Human Resources', label: 'Human Resources' },
        { value: 'Legal', label: 'Legal' },
    ]

        const handleSelect = (selectVal)=>{
        setDepartment(selectVal)
    }

    return (
        <div className="App">
            <h1>Coucou</h1>
            <ChrisDropdown
                handleSelect={handleSelect}
                name="department"
                id="department"
                options={departments}
            />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <p>Selected value from the child component Dropdown <br/> displayed in the parent component App</p>
            <h3> {department} </h3>
        </div>
    );
};
```

In this example, we're using the `ChrisDropdown` component to create a dropdown menu with three options. We're also keeping track of the currently selected value using the `useState` hook, and updating it when the user selects a different option from the dropdown.

## Props

`ChrisDropdown` accepts the following props:

- `options`: An array of objects representing the options in the dropdown. Each object should have a `value` and a `label` property.
- `handleSelect`: A callback function that is called when the user selects a different option from the dropdown. The function is passed the selected value as its first argument.


## License

`ChrisDropdown` is licensed under the MIT license.

I hope this README file helps you understand how to use the `Dropdown` component in your React applications.

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