Back to Components

Elastic Dropdown

A single elastic dropdown whose outline itself deforms open and closed via a mass-spring simulation, with full keyboard, ARIA listbox, and click-outside support.

Preview

Installation

Install the component using the CLI.

npx shadcn@latest add https://shreyashtech.me/r/elastic-dropdown.json

Usage

Import the component:

import ElasticDropdownShowcase, { ElasticDropdown } from "@/components/elastic-dropdown"

Use it in your code:

<ElasticDropdown placeholder="Project" onChange={(value) => console.log(value)} />

Props

PropertyTypeDefaultDescription
optionsElasticDropdownOption[]Personal / Work / Design / DevelopmentSelectable options.
onChangefunction-Called with the selected value.
placeholderstring"Select option"Text shown when nothing is selected.