Skip to content

This is a simple dropdown component built using React. The dropdown displays a list of options when hovering over the button and closes the dropdown when an option is clicked.

Notifications You must be signed in to change notification settings

Mansi523/dropdown-using-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Simple Dropdown Component

This is a simple dropdown component built using React. The dropdown displays a list of options when hovering over the button and closes the dropdown when an option is clicked.

Usage

To use the dropdown component in your React application, follow these steps:

Installation

First, make sure you have a React project set up. If not, you can create one using Create React App or any other method.

  1. Clone or download this repository.

  2. Copy the Dropdown.js component into your project.

Props

The Dropdown component accepts a single prop:

  • items (Array): An array of items to display in the dropdown list.

Example Usage

import React from 'react';
import Dropdown from './Dropdown';

const options = ['Option 1', 'Option 2', 'Option 3'];

function App() {
  return (
    <div className="App">
      <h1>Simple Dropdown Example</h1>
      <Dropdown items={options} />
    </div>
  );
}

export default App;

AUTHOR

Mansi Kumari

LANDING PAGE

Screenshot-26

DEMO

About

This is a simple dropdown component built using React. The dropdown displays a list of options when hovering over the button and closes the dropdown when an option is clicked.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published