Skip to Content
Kokonut UI

BT-12Buttons

Morph Popover

A button that grows into the form it opens, with its label sliding up to become the title, then shrinks into a confirmation.

Install with
motion

PROPay Button and more like it are in Kokonut UI Pro

Installation

Morph Popover is a free, open-source React component in the Kokonut UI Buttons collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/morph-popover.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/morph-popover

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/morph-popover.tsx.

npm install motion

Usage

import MorphPopover from "@/components/kokonutui/morph-popover";

export default function Example() {
  return <MorphPopover />;
}

Props

label
stringDefault "Feedback"

The button's label, which slides up to become the panel's title.

icon
ReactNodeDefault <ChatIcon />
placeholder
stringDefault "What would make this better?"
sentLabel
stringDefault "Thanks!"

Shown in the small pill after sending.

onSubmit
(value: string) => void | Promise<void>Default pretendSend

Called with the text. A promise keeps the panel in its sending state.

align
"start" | "end"Default "start"

Which edge the panel grows from.

width
numberDefault 340

Panel width in px.

className
string

Extra classes for the root element.

Dependencies

NeedsVersionComes from
motion^12.23.25npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.