Docs
Installation
Add any section or component to your project with one command. Five steps from an empty terminal to a piece running on your page.
- 1
Open your project
You need a React project with Tailwind CSS 4 and TypeScript. Next.js is what the library is built and tested on. No project yet? Create one:
npx create-next-app@latest my-siteThen open a terminal in the root of the project, the folder with
package.json. - 2
Pick what you want
Browse the library and open any piece. Its page shows a live preview and the exact command under the title. You can also print every name in the terminal:
npx motionsnack list - 3
Add it
Run the command with the name of the piece. Several names at once work too.
npx motionsnack add glow-drift-heroThe command does three things:
- saves the file to
src/components/motionsnack/(orcomponents/motionsnack/without asrcfolder), - installs the npm packages the file needs and you do not have yet,
- downloads its demo images and videos into
public/.
Your other files are not touched, and a file you already have is kept.
- saves the file to
- 4
Use it on a page
The command ends by printing the import line. Paste it into a page and render the component, for example in
src/app/page.tsx:import { GlowDriftHero } from "@/components/motionsnack/glow-drift-hero"; export default function Home() { return ( <main> <GlowDriftHero /> </main> ); }Start the dev server with
npm run devand open the page. The piece shows up with its demo content. - 5
Make it yours
Texts, links, colours and motion are props. Tune them in the Customize panel on the piece's page, then pass the same values in your code:
<GlowDriftHero title="Websites that move" subtitle="Design and build for small teams." primaryCta={{ label: "Book a call", href: "/contact" }} glowColor="#0044ff" speed={1.5} />The file is plain React and Tailwind in your own project. Open it and change anything the props do not cover.
Options
Add these after the names, for example npx motionsnack add glow-drift-hero --overwrite.
- --path <dir>
- Put the files somewhere else than components/motionsnack.
- --overwrite
- Replace a file you already have, for example to get a newer version.
- --no-install
- Skip installing packages and only print what is missing.
- --no-assets
- Skip the demo images and videos.