Quick start
Installation
npm install @olddevs/ui reactReact is the kit's only peer dependency (ADR-0072): the app picks its version, and the app
must have exactly one copy of it. The kit brings every other library itself, in its own
dependencies: Radix, react-aria-components, @internationalized/date, lucide-react,
sonner, clsx and tailwind-merge. You don't need to list them in your app's package.json.
If your app uses one of them directly, keep its range compatible with the kit's. Otherwise the
build ends up with two copies, and the layers, contexts and providers of one copy can't see the
other's (see Troubleshooting). For the same reason, import LucideProvider
from @olddevs/ui/icons and toast from @olddevs/ui, not from lucide-react and sonner.
The Editor engine is not on the list: only an app that imports @olddevs/ui/editor installs
it — the command is on the Editor page.
Importing components
import { Button, TextControl } from "@olddevs/ui";
import { AddIcon } from "@olddevs/ui/icons";Import only the package's public entry points — they are all listed in exports of
package.json and in the glossary (., /icons, /color, /markdown, /editor,
/editor/schema, /editor/highlight, /locales/ru, /locales/en, plus
styles.css). Do not import @olddevs/ui/src/components/...: that path is not part of the package contract and may
change without a migration.
Adding the CSS
The consumer's CSS needs all three lines:
@import "tailwindcss";
@import "@olddevs/ui/styles.css";
@source "./node_modules/@olddevs/ui/dist";@import "tailwindcss" belongs to the consumer app, not to the package. Do not
import Tailwind a second time. @source is required: Tailwind 4 does not scan
node_modules automatically, so without it the build can succeed
with no component classes in the final CSS.
If the app does not use the Editor (@olddevs/ui/editor), add a fourth line:
@source not "./node_modules/@olddevs/ui/dist/editor";@source over the whole dist scans the Editor too, so its classes (the Toolbar, menus,
.ProseMirror) end up in the CSS even when the entry point is never imported. Measured on a
Next.js 16 app without the Editor: 160 kB of CSS without the line, 113 kB with it. Once you
import the Editor, remove the line: otherwise its classes do not reach the CSS, and the
build, just as without @source, passes silently.
Quick example
import { Button, FormField, TextControl } from "@olddevs/ui";
import { AddIcon } from "@olddevs/ui/icons";
export function CreateProjectForm() {
return (
<form>
<FormField label="Project name" htmlFor="name">
<TextControl id="name" name="name" />
</FormField>
<Button type="submit" icon={<AddIcon aria-hidden />}>
Create
</Button>
</form>
);
}Next step: pick a component for your task, then open its page in the catalog.
A page in the app shell
Since 2.1.0 you no longer need to write the app shell yourself: the side navigation, the header and the layout come from the kit.
import { AppShell, NavGroup, NavItem, SideNav, TopBar } from "@olddevs/ui";
import { DashboardIcon } from "@olddevs/ui/icons";
import Link from "next/link";
import { usePathname } from "next/navigation";
export function Layout({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
return (
<AppShell
routeKey={pathname}
sidebar={
<SideNav>
<NavGroup label="Work">
<NavItem
label="Dashboard"
icon={<DashboardIcon />}
active={pathname.startsWith("/dashboard")}
asChild
>
<Link href="/dashboard" />
</NavItem>
</NavGroup>
</SideNav>
}
header={<TopBar brand={<Logo />} />}
>
{children}
</AppShell>
);
}Three things the kit deliberately leaves to you: route comparison
(active is a prop), persisting the collapsed state of the sidebar, and applying the theme.
Details are on the AppShell and
SideNav pages.
Interface language
The kit defaults to English. Russian labels are added with one line:
import { UiProvider } from "@olddevs/ui";
import ru from "@olddevs/ui/locales/ru";
<UiProvider locale="ru-RU" messages={ru}>
<App />
</UiProvider>;The message catalog does not load automatically: otherwise it would end up in everyone's bundle, including those who
only need English. The order in which a string is resolved, partial catalogs and
integration with react-aria's I18nProvider — i18n.md.