Install the packages

ReactLoom uses the @reactloom package scope. Start with the core components and theme.

Terminal
pnpm add @reactloom/ui @reactloom/theme
# npm install @reactloom/ui @reactloom/theme
# yarn add @reactloom/ui @reactloom/theme

Peer dependencies: react and react-dom 18.2 or newer (19 supported).

Import the styles

Import both stylesheets once, at your application entry. Their order does not matter — both declare the same cascade-layer order.

main.tsx
import '@reactloom/theme/theme.css'; // tokens + built-in themes
import '@reactloom/ui/styles.css';   // component styles

Per-component CSS (optional)

styles.css contains every component. If CSS size matters, import only the modules you use instead — each file is under 2.5 kB gzip:

main.tsx
import '@reactloom/theme/theme.css';
// Instead of '@reactloom/ui/styles.css':
import '@reactloom/ui/css/button.css';
import '@reactloom/ui/css/actions.css'; // IconButton, CloseButton (used by Dialog)
import '@reactloom/ui/css/dialog.css';
ComponentsImport
Box, Stack, Grid, Container, Divider, AspectRatiocss/layout.css
Text, Heading, Link, Code, Kbd, listscss/typography.css
Buttoncss/button.css
IconButton, CloseButton, ButtonGroup, ToggleButtoncss/button.css + css/actions.css
Spinnercss/spinner.css
Input, Textarea, PasswordInput, SearchInputcss/field.css + css/button.css + css/actions.css + css/input.css
Checkbox, Radio, Switch, SegmentedControlcss/field.css + css/choice.css
FormField, Fieldsetcss/field.css
Cardcss/card.css
Dialogcss/button.css + css/actions.css + css/dialog.css
Alert, Banner, Badge, Tag, Progress, Skeletoncss/feedback.css
Avatar, AvatarGroupcss/avatar.css
Accordion, Collapsiblecss/disclosure.css

The same mapping ships as @reactloom/ui/css/manifest.json for tooling.

Optional packages

Heavier families ship as separate packages, so apps that do not need them pay nothing. Each one adds its own stylesheet after the core one.

Terminal
pnpm add @reactloom/dates
main.tsx
import '@reactloom/theme/theme.css';
import '@reactloom/ui/styles.css';
import '@reactloom/dates/styles.css'; // DatePicker, Calendar, DateField…

Bundle size

Every component is a separate ES module, so you only ship what you import. Measured sizes (minified + brotli, React excluded):

ImportSize
Stack, Text< 1 kB each
Button, Input, Card, Tabs, Pagination1–1.5 kB each
Dialog, Drawer~3 kB
Popover (positioning engine included)~8 kB
Tooltip, Menu, Select, Combobox (React Aria)13–45 kB individually; ~44 kB for all four together

The interactive widgets use React Aria for their keyboard and screen-reader behaviour. Its core is shared, so each additional React Aria component adds only a few kilobytes. If you support few languages, React Aria’s @react-aria/optimize-locales-plugin removes unused translations (~2 kB).

Add a ThemeProvider (optional)

Without a provider, components use the light theme declared on :root. Wrap your app to follow the OS preference or switch at runtime:

App.tsx
import { ThemeProvider } from '@reactloom/theme';
import { Button } from '@reactloom/ui';

export function App() {
  return (
    <ThemeProvider defaultTheme="system">
      <Button onClick={() => alert('Hello')}>Get started</Button>
    </ThemeProvider>
  );
}

If you have global CSS

ReactLoom’s CSS lives in cascade layers, so un-layered CSS wins — including global element rules such as a { color }. Put resets in a layer declared before ReactLoom’s:

index.html
<style>@layer reset, base, pl;</style>

Compatibility

React18.2+, 19 — tested on both in CI
BrowsersLast two versions of Chrome, Edge, Firefox and Safari (incl. iOS)
BundlersAny ESM bundler: Vite, webpack 5, Rspack, Next.js, Parcel
TypeScript5.0+; types resolve with moduleResolution bundler and node16
SSRYes — see Next.js & SSR
PolicySemantic versioning with documented deprecation notices across major releases.