Placeholders And Vanish Input

Search input with rotating placeholder text and vanishing text animation on submit

Installation

pnpm dlx shadcn@latest add "https://vritti.thesatyajit.com/r/placeholders-and-vanish-input"

Dependencies

pnpm add motion

Examples

"use client";

import { PlaceholdersAndVanishInput } from "@/components/vritti/placeholders-and-vanish-input";

export function PlaceholdersAndVanishInputSearchExample() {
  return (
    <div className="flex items-center justify-center p-8">
      <PlaceholdersAndVanishInput
        placeholders={[
          "How do I center a div?",
          "What is React Server Components?",
          "Explain TypeScript generics",
          "Best practices for CSS Grid",
        ]}
        onChange={() => {}}
        onSubmit={() => {}}
      />
    </div>
  );
}