Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

New Menus

Public visualization

Viewing a saved revision (read-only)

16065ad10d21499488d96f667d1ae5e1

New Menus

0 stars0🌍 Public
CCodeDuckie99
Last edited Mar 13, 2021
Created on Mar 13, 2021
Forked from Menus with React

This example demonstrates a reusable dropdown menu component built with React and the useState hook. It displays a list of pet options—dog, cat, hamster, parrot, spider, and goldfish—with a default selection of hamster, and logs the currently selected value to the console. The Dropdown component takes options, an id, a selected value, and a change handler as props, rendering a native HTML select element. The app uses ReactDOM to mount the component, with styling applied via CSS for large text and a hidden overflow.

AI-generated description

React starter code.

See also React Starter.