Morphing Popover
Trigger that morphs into a non-modal dialog surface.
Import
import { MorphingPopover, MorphingPopoverTrigger, MorphingPopoverContent, MorphingPopoverClose, MorphingPopoverHeader, MorphingPopoverBody, MorphingPopoverFooter, MorphingPopoverButton } from "@cooud-ui/ui";
npx cooud-ui add morphing-popover
Examples
API Reference
Generated from the component's exported types.
MorphingPopoverProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled open state. When provided, the component is fully controlled. |
defaultOpen | boolean | false | Initial open state for the uncontrolled case. |
onOpenChange | (open: boolean) => void | — | Called whenever the open state should change (controlled or not). |
transition | Transition | MORPHING_POPOVER_TRANSITION | Override the morph spring (advanced — defaults to the Cooud morph spring). |
reducedMotion | "user" | "always" | "never" | "user" | How `prefers-reduced-motion` is honoured. Defaults to `"user"`: users who opt out get a fade instead of the layout morph. Pass `"never"` to always play the morph (e.g. a showcase that must demonstrate the animation), or `"always"` to force the reduced variant for everyone. |
children | ReactNode | — | — |
MorphingPopoverTriggerProps
Extends Omit< React.ComponentPropsWithoutRef<typeof motion.button>, "ref" | "children" | "onClick" >
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | — |
onClick | (event: React.MouseEvent<HTMLButtonElement>) => void | — | Extra click handler; runs alongside the open toggle. |
MorphingPopoverContentProps
Extends Omit<React.ComponentPropsWithoutRef<typeof motion.div>, "ref" | "children">
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | — |
aria-label | string | — | Accessible name when the content has no visible heading to point at. |
aria-labelledby | string | — | Id of a visible heading element (e.g. a ). |
MorphingPopoverCloseProps
Extends ButtonHTMLAttributes<HTMLButtonElement>
No own props — see the extended type above for available props.
MorphingPopoverHeaderProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
MorphingPopoverBodyProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
MorphingPopoverFooterProps
Extends HTMLAttributes<HTMLDivElement>
No own props — see the extended type above for available props.
MorphingPopoverButtonProps
Extends ButtonHTMLAttributes<HTMLButtonElement>
No own props — see the extended type above for available props.