sona-ui

Animated Dialog

Component

About

A composable, accessible dialog modal built on Base UI with controlled state, direction-aware enter and exit motion, and reduced-motion support.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Animated Dialog to your project and fits it to your theme.

Code

How Animated Dialog is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import { AnimatedDialog, AnimatedDialogClose, AnimatedDialogContent, AnimatedDialogDescription, AnimatedDialogTitle, AnimatedDialogTrigger } from "@/components/ui/sona-animated-dialog"

export default function AnimatedDialogDemo() {
  return (
    <div className="flex flex-col items-center gap-6">
      <AnimatedDialog>
        <AnimatedDialogTrigger>Open Dialog</AnimatedDialogTrigger>
        <AnimatedDialogContent from={"bottom"}>
          <AnimatedDialogTitle>Directional Transition</AnimatedDialogTitle>
          <AnimatedDialogDescription>
            This modal is configured to animate from the{" "}
            <span className="font-semibold text-foreground capitalize">
              "Bottom"
            </span>
            . You can test all entry vectors using the switcher above.
          </AnimatedDialogDescription>
          <div className="mt-6 flex justify-end gap-3">
            <AnimatedDialogClose className="bg-destructive/80 hover:bg-destructive hover:cursor-pointer">
              Cancel
            </AnimatedDialogClose>
            <AnimatedDialogClose className="bg-primary/80 hover:bg-primary text-primary-foreground hover:cursor-pointer">
              Confirm
            </AnimatedDialogClose>
          </div>
        </AnimatedDialogContent>
      </AnimatedDialog>
    </div>
  );
}

Dependencies

More by sona-ui

View all
  • Stagger Text

    Stagger Text

    8
  • Dot Orbit Shader

    Dot Orbit Shader

  • Mesh Gradient Shader

    Mesh Gradient Shader

  • Split Text

    Split Text

  • Image Trail

    Image Trail

  • Section Rail

    Section Rail

  • Activity Graph

    Activity Graph

  • Fluid Slider

    Fluid Slider