Skip to content
TrademarkTrademark
Docs
Docs

Installation

Updated: October 20, 2026
View on GitHub

Starter template

Create a new Once UI app with our starter repository. It will install dependencies and set up the recommended structure:

Or add Once UI to an existing project:

In a Next.js app, add Once UI to optimizePackageImports in next.config. Without it, a server component that imports from the package root ships about 110 kB of extra JavaScript on every route:

That setting only works with webpack. Next.js 16 builds with Turbopack by default, which ignores it and does not need it: Once UI lists every export by name in its entry points, so a page ships only the components it imports, from the package root, under either bundler. On a page with a Button and a Column that is about 11 kB of component CSS instead of 108 kB. Each component also has its own path, such as @once-ui-system/core/components/Button, if you prefer one import per component.

Upgrading an app from 1.8? Follow the migration guide: a codemod does most of it, and it lists what is left in the order that keeps your app building.

Dependencies

Installed with Once UI Core, nothing to do:

Package
Version
Purpose
@floating-ui/react-dom^2.1.9Positioning for dropdowns, tooltips and popovers
clsx^2.1.1Conditional class names
date-fns^4.4.0Date pickers and inputs

Your app provides these. Components ship their styles as precompiled CSS modules, which Next.js, Vite and other bundlers handle with no setup, so your app needs no sass (3.0 dropped it as a peer):

Package
Version
Purpose
react>=19React
react-dom>=19React DOM

Optional dependencies

Install these only for the features that need them. Each module named here comes from its own subpath, not the package root:

Package
Version
Used for
next>=15.5Next.js apps: LayoutProvider from @once-ui-system/core/next routes links and images through next/link and next/image
prismjs^1.30.0CodeBlock from @once-ui-system/core/code
compressorjs^1.3.0MediaUpload from @once-ui-system/core/media

Icons ship inlined, so no icon library is required. To use more icons, register any React icon components — react-icons, lucide or your own SVGs — through IconProvider.

Edit this page on GitHub