Spaces:
Running
Running
UI Components (shadcn-friendly)
This folder contains four UI components taken from 21st.dev templates and prepared for a shadcn/Tailwind/TypeScript Next.js project:
animated-shader-hero.tsxβ full-screen animated WebGL shader herosidebar.tsxβ responsive animated sidebar (framer-motion)ai-chat-input.tsxβ animated AI chat input with placeholder cyclingloader-10.tsxβ gooey loader
Also provided: small demo pages demo-*.tsx showing usage.
Important notes before using
- These files assume a standard shadcn structure (Next.js with
components/uifolder). If your project doesn't use@/path aliases, adjust imports accordingly. - The helper
cnfunction is imported from@/lib/utils. If you don't have it, create a small utility:
// lib/utils.ts
export function cn(...args: Array<string | false | null | undefined>) {
return args.filter(Boolean).join(' ');
}
Required NPM packages
- framer-motion
- lucide-react
- motion (for
motion/reactused in ai-chat-input) OR replace withframer-motionmotion
Suggested install (run in your project root, PowerShell):
npm install framer-motion lucide-react
# If you want the motion/react API used above, install `motion` (but framer-motion can be used instead)
npm install motion
Tailwind / shadcn / TypeScript setup
- If you do not have a project scaffolded, follow shadcn CLI to create the base UI system. From your project root:
npx shadcn@latest init
# or to add specific components:
npx shadcn@latest add https://21st.dev/r/ravikatiyar162/animated-shader-hero
npx shadcn@latest add https://21st.dev/r/aceternity/sidebar
npx shadcn@latest add https://21st.dev/r/preetsuthar17/ai-chat-input
npx shadcn@latest add https://21st.dev/r/ravikatiyar162/loader-10
Tailwind: if not present, install Tailwind CSS and configure with Next.js β follow the official Tailwind docs: https://tailwindcss.com/docs/guides/nextjs
TypeScript:
npm install -D typescript @types/react @types/nodeand addtsconfig.json.
Default component path
- shadcn tends to use
components/uifor reusable UI primitives. If your project places components elsewhere, createcomponents/uiand keep these files there β it helps keep shadcn components discoverable and consistent with the rest of the ecosystem and the shadcn CLI.
Assets
- I used an Unsplash image URL in the sidebar demo. Replace with your preferred images.
Next steps I can do for you
- Wire these components into your Next.js pages (index page with hero -> chat sidebar layout).
- Replace
motion/reactusage withframer-motionfor consistency. - Run a local dev build and fix any TypeScript errors.