Installation
Choose the package to get updates through upgrades, or the CLI to own and edit component source. Both load the same stylesheet, ui.css.
Prerequisites
- Svelte 5 (the CLI defaults assume SvelteKit)
- Tailwind CSS v4
Option A: Package import
Install the library and import components from @sivir-ui/svelte.
Import the stylesheet once in your root CSS file, in place of @import 'tailwindcss';. It imports
Tailwind for you:
Use a component:
Compound components use a namespace export (for example Modal with Modal.Root, Modal.Content, …).
Option B: CLI source copy
The sivir binary ships in @sivir-ui/svelte, so these commands run
it with bunx @sivir-ui/svelte. It copies
component source into your project. These commands need Bun 1.3.14 or later. With npm,
use npx @sivir-ui/svelte.
1. Create a project (optional)
2. Add Tailwind v4
3. Initialize Sivir
Copies ui.css and shared utilities into src/lib/sivir/, writes sivir.json, and installs the shared
dependencies. -y accepts the default directory and import alias and skips the confirmations for
installing dependencies and editing your stylesheet.
4. Import the stylesheet
ui.css includes Tailwind, so it replaces @import 'tailwindcss';. init makes this change in the stylesheet sv add tailwindcss creates. Make it yourself if your root stylesheet lives elsewhere:
5. Add components
add copies each component with its dependencies and offers to install the npm packages they
need. Pass '*', quoted, to add every component.
6. Use them
Notes
- Tailwind v3 is not supported. Sivir needs v4
@themeandcolor-mix. - Dark mode applies under a
.darkclass on<html>. Sivir reads the class but does not toggle it. - In a CLI project, install a built-in theme preset with
bunx @sivir-ui/svelte add theme <slug>(for exampleraven). It writestheme.cssnext toui.css; import it afterui.css.
bun add @sivir-ui/svelte # npm i @sivir-ui/svelte # pnpm add @sivir-ui/svelte