Morph Surface
betaA dock that grows in place into a panel — a feedback form or a quick prompt — and shrinks back when done.
- Overlays
- 1 file
- No extra npm packages
- Accessibility notes
pnpm dlx @dowel-ui/cli add morph-surfaceNo npm packages are needed beyond what Dowel already requires.
import { MorphSurface } from "@/components/ui/morph-surface";Default
Gallery
<MorphSurface>
| Prop | Type | Default |
|---|---|---|
label (required)The trigger's text in the dock, e.g. "Ask AI" or "Feedback". | ReactNode | — |
defaultOpen | boolean | false |
iconDecoration beside the label (an orb, a logo). Hidden from assistive technology. | ReactNode | — |
onOpenChange | (open: boolean) => void | — |
open | boolean | — |
panelHeightThe expanded panel's height. Numbers are pixels. | Size | "12.5rem" |
panelLabelThe panel's accessible name, also shown by | string | — |
panelWidthThe expanded panel's width. Numbers are pixels. | Size | "22.5rem" |
successDurationHow long the success label stays, in milliseconds. | number | 1500 |
successLabelShown in the dock, and announced, after the panel closes successfully. | string | "Sent" |
Plus every attribute of <div>.
<MorphSurfaceForm>
| Prop | Type | Default |
|---|---|---|
fieldNameThe textarea's form field name. | string | "message" |
onSubmitCalled with the trimmed message. Return | (value: string, event: FormEvent<HTMLFormElement>) => boolean | void | — |
placeholder | string | "Ask me anything…" |
submitLabelThe submit button's accessible name. The visible text is the shortcut. | string | "Send" |
Plus every attribute of <form> except onSubmit.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes