MorphSelect

Menu springs out of the trigger. One highlight stretches between options. Inputs.

Open playground

About

MorphSelect is a React component in the Inputs category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { MorphSelect } from "@ashutoshswamy/smoui" and set options, value, onChange among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { MorphSelect } from "@ashutoshswamy/smoui";

<MorphSelect
  label="Easing"
  options={[{ value: "spring", label: "Spring" }, { value: "tween", label: "Tween" }]}
  onChange={(v) => console.log(v)}
/>

Props 4

options

Choices.

{ value: string; label: string }[]
value / defaultValue

Controlled or initial value.

string
onChange

Called on pick.

(value: string) => void
label

Accessible name. Arrow keys, Enter and Escape work.

string