Baktiyar Ablaikhan

Placeholders And Vanish Input

Source
Aceternity UI ↗
Author
Aceternity UI
Licence
Aceternity UI licence (free component)

Loading…

Placeholders cycle, and submitted text dissolves into particles.

Code

"use client";

import { PlaceholdersAndVanishInput } from "@/lab/aceternity/ui/placeholders-and-vanish-input";

const placeholders = [
  "What's the first rule of Fight Club?",
  "Who is Tyler Durden?",
  "Where is Andrew Laeddis Hiding?",
  "Write a Javascript method to reverse a string",
  "How to assemble your own PC?",
];

export default function PlaceholdersAndVanishInputDemo() {
  return (
    <div className="@container relative flex h-full w-full flex-col items-center justify-center px-4">
      <h2 className="mb-[clamp(1rem,6cqw,4rem)] text-center text-[clamp(1.1rem,4.5cqw,3rem)] text-black dark:text-white">
        Ask Aceternity UI Anything
      </h2>
      <PlaceholdersAndVanishInput placeholders={placeholders} />
    </div>
  );
}
Prompt

Build "Placeholders And Vanish Input", a input animation. What it does: Placeholders cycle, and submitted text dissolves into particles. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS, using motion. Technique: an HTML canvas, a requestAnimationFrame loop, the Motion library. It sits on a light background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://ui.aceternity.com/components/placeholders-and-vanish-input (Aceternity UI, Aceternity UI licence (free component)).