Docs
Installation

Installation

Million.js assumes that you've already initialized a React project. If you haven't, it is recommended you check out react.dev (opens in a new tab) first.

⚠️

If you have a CRA (Create React App (opens in a new tab)) Setup, you will need to have Craco (opens in a new tab) configured before proceeding

Setup in seconds

The Million.js CLI will automatically install the package and configure your project for you.

npx million@latest

That's it! Your project is now running on Million.js

Million.js is compatible with React 16 and above. If you're using an older version of React, you'll need to upgrade first.

Configure It Yourself

In the case you want more granular control over the installation process, you can follow the steps below.

Install package

First things first, you'll need to install Million.js. You can do this with your favorite package manager:

npm install million

Use the compiler

Then, add the compiler to your build tool of choice:

Million.js is supported within the /app ("use client" components only) and /pages

next.config.mjs
import million from 'million/compiler';
 
/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
};
 
const millionConfig = {
  auto: true,
  // if you're using RSC:
  // auto: { rsc: true },
}
 
export default million.next(nextConfig, millionConfig);

Checkout Automatic Mode to learn about the mechanisms behind Automatic mode.