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.jsonUsage
Import the component:
import ElasticDropdownShowcase, { ElasticDropdown } from "@/components/elastic-dropdown"Use it in your code:
<ElasticDropdown placeholder="Project" onChange={(value) => console.log(value)} />Props
| Property | Type | Default | Description |
|---|---|---|---|
| options | ElasticDropdownOption[] | Personal / Work / Design / Development | Selectable options. |
| onChange | function | - | Called with the selected value. |
| placeholder | string | "Select option" | Text shown when nothing is selected. |