Getting Started
Installation, project structure, and quick start guide
Installation
You can run the CLI or install the npm package; both support npm, pnpm, yarn, and bun. Use the tabs below: click a tab to select your package manager, then copy the command. For the CLI: choose framework (Vanilla, Astro, Svelte, React, or Vue), then add to existing or create new project. Both use the same template choice (CSS only | Landing | Docs | Dashboard | Full). Add is for existing projects only: run npx rizzo-css add in your project root, choose a template, then select which components to add (or CSS only for the stylesheet only). CSS only = no components; Landing/Docs/Dashboard = component picker (all 53 or pick); Full = site clone (no picker). You must add the <link> yourself (CLI prints the exact tag). Create new: choose project location, then template โ CSS only (stylesheet + license, README, .gitignore; no web pages or components), Landing (hero/features page), Docs (sidebar + sample doc), Dashboard (sidebar + stats/table), or Full (clone of the docs site). CSS only skips the component picker; Landing, Docs, and Dashboard then prompt for all 57 components or pick; Full skips the picker. We never overwrite existing files; any skipped content goes into RIZZO-SETUP.md. The package includes dist/rizzo.min.css, the CLI, and scaffolds. Component dependencies: Navbar adds Search and Settings; Settings adds ThemeSwitcher, FontSwitcher, SoundEffects; Toast adds Alert. add writes RIZZO-SETUP.md for all templates; Full also writes RIZZO-SNIPPET.txt unless --no-snippet. Init: --template css-only|landing|docs|dashboard|full. See the npm package and project README for CLI details.
Run the CLI
Click a tab to select your package manager, then use the copy button to copy the command.
Choose your package manager โ click a tab to select, then copy the command.
Add to existing project:
Choose your package manager โ click a tab to select, then copy the command.
To add a specific component without prompts, include its name: e.g. npx rizzo-css add Button or npx rizzo-css add ThemeSwitcher. Some components add others automatically (e.g. Navbar adds Search and Settings; Settings adds ThemeSwitcher, FontSwitcher, SoundEffects; Toast adds Alert). Run npx rizzo-css help components for the full list. Each component doc page has the exact command with copy buttons. For theme (list theme IDs), use the same pattern: npx rizzo-css theme, pnpm dlx rizzo-css theme, and so on.
Install the npm package
Choose your package manager, then copy the command to add Rizzo CSS to your project.
Choose your package manager โ click a tab to select, then copy the command.
Installation by framework
Use the steps below for your framework. The CLI prints the exact <link> tag when you run init or add.
Vanilla JS
- New project:
npx rizzo-css initโ choose Vanilla JS โ CSS only (index + CSS + RIZZO-SETUP.md; no components), Landing (CSS + RIZZO-SETUP.md, or full index + all components if you choose โallโ), Docs / Dashboard (docs or dashboard overlay + component pages, all or pick; same five templates as Astro/Svelte), or Full (site clone: index + Navbar, Settings, Footer + all component pages + js + icons). We never overwrite โ snippets in RIZZO-SETUP.md. - Add to existing: Run
npx rizzo-css addin your project root; add the printed<link>to your HTML. - CSS: CLI writes
css/rizzo.min.css. Link it or use a CDN (see README-RIZZO.md). - Components: Same BEM classes as the Components docs. Core includes
js/main.jsfor interactivity; see Vanilla component pages for copy-paste HTML.
Astro
- New project:
npx rizzo-css initโ choose Astro โ CSS only / Landing / Docs / Dashboard / Full (CSS only = no components; Full = site clone; others = all 52 or pick components); pick package manager. Existing files are never overwritten; see RIZZO-SETUP.md for snippets. - Add to existing:
npx rizzo-css addin the project root, ornpm create astro@latest my-app && cd my-app && npx rizzo-css add. Add the printed<link>to your root layout. - CSS:
public/css/rizzo.min.css. In layout:<link rel="stylesheet" href="/css/rizzo.min.css" />orimport 'rizzo-css'. - Components: Copied to e.g.
src/components/rizzo/. Use same BEM as Components; layout includes theme and toast.
Svelte (SvelteKit)
- New project:
npx rizzo-css initโ choose Svelte โ CSS only / Landing / Docs / Dashboard / Full (CSS only = no components; Full = site clone; others = all 52 or pick components); pick package manager. Existing files are never overwritten; see RIZZO-SETUP.md for snippets. - Add to existing:
npx rizzo-css addin the project root, ornpm create svelte@latest my-app && cd my-app && npx rizzo-css add. Add the printed<link>toapp.html. - CSS:
static/css/rizzo.min.css. Inapp.html:<link rel="stylesheet" href="/css/rizzo.min.css" />. - Components:
import { Button, Badge, Card, ... } from '$lib/rizzo'. See Svelte docs and component pages (Astro | Vanilla | Svelte | Vue | React tabs).
React
- New project:
npx rizzo-css initโ choose React โ CSS only / Landing / Docs / Dashboard / Full (same template options as Astro/Svelte). Existing files are never overwritten; see RIZZO-SETUP.md for snippets. - Add to existing:
npx rizzo-css addin the project root. Add the printed<link>to your root layout orindex.html. - CSS: Same path as your framework (e.g.
public/css/rizzo.min.cssorsrc/styles/rizzo.min.css). Link in layout or import in app entry. - Components: Scaffold copies React components to your project. See React component docs for live examples and TSX code blocks.
Vue
- New project:
npx rizzo-css initโ choose Vue โ CSS only / Landing / Docs / Dashboard / Full (same template options as Astro/Svelte). Existing files are never overwritten; see RIZZO-SETUP.md for snippets. - Add to existing:
npx rizzo-css addin the project root. Add the printed<link>to your root layout orindex.html. - CSS: Same path as your framework. Link in layout or import in app entry.
- Components: Scaffold copies Vue (.vue) components to your project. See Vue component docs for live examples and SFC code blocks.
Rizzo CSS is built on Astro. To work on this docs site and reference components (clone the repo):
# Clone the project
git clone <repository-url>
cd rizzo-css # Install dependencies
pnpm install Project Structure
rizzo-css/
โโโ src/
โ โโโ components/ # Astro components
โ โ โโโ Accordion.astro
โ โ โโโ Alert.astro
โ โ โโโ Badge.astro
โ โ โโโ Breadcrumb.astro
โ โ โโโ Button.astro
โ โ โโโ Card.astro
โ โ โโโ CodeBlock.astro
โ โ โโโ FrameworkCodeTabs.astro
โ โ โโโ CopyToClipboard.astro
โ โ โโโ Dropdown.astro
โ โ โโโ FormGroup.astro
โ โ โโโ Input.astro
โ โ โโโ Textarea.astro
โ โ โโโ Select.astro
โ โ โโโ Checkbox.astro
โ โ โโโ Radio.astro
โ โ โโโ Modal.astro
โ โ โโโ Navbar.astro
โ โ โโโ Pagination.astro
โ โ โโโ ProgressBar.astro
โ โ โโโ Search.astro
โ โ โโโ Spinner.astro
โ โ โโโ Avatar.astro
โ โ โโโ Divider.astro
โ โ โโโ Table.astro
โ โ โโโ Settings.astro
โ โ โโโ Tabs.astro
โ โ โโโ ThemeSwitcher.astro
โ โ โโโ Toast.astro
โ โ โโโ Tooltip.astro
โ โ โโโ icons/ # Icon components (same set for Astro, Svelte, React, Vue, Vanilla)
โ โ โโโ Copy.astro
โ โ โโโ Check.astro
โ โ โโโ ChevronDown.astro
โ โ โโโ Circle.astro
โ โ โโโ Close.astro
โ โ โโโ Cat.astro
โ โ โโโ Cmd.astro
โ โ โโโ Gear.astro
โ โ โโโ Search.astro
โ โ โโโ (theme icons: Owl, Palette, Sun, Flame, Heart, Leaf, Shield, Zap, Rainbow, Cake, Sunset, Cherry, Brush, Lemon, etc.)
โ โ โโโ devicons/ # Devicon brand icons
โ โ โโโ Astro.astro
โ โ โโโ Bash.astro
โ โ โโโ Css3.astro
โ โ โโโ Git.astro
โ โ โโโ Html5.astro
โ โ โโโ Javascript.astro
โ โ โโโ Nodejs.astro
โ โ โโโ Plaintext.astro
โ โ โโโ React.astro
โ โ โโโ Svelte.astro
โ โ โโโ Vue.astro
โ โโโ layouts/ # Page layouts
โ โ โโโ Layout.astro
โ โโโ pages/ # Route pages
โ โโโ styles/ # CSS files
โ โโโ accessibility.css
โ โโโ base.css
โ โโโ buttons.css
โ โโโ components.css
โ โโโ forms.css
โ โโโ layout.css
โ โโโ main.css
โ โโโ pages.css
โ โโโ reset.css
โ โโโ spacing.css
โ โโโ sizes.css
โ โโโ typography.css
โ โโโ utilities.css
โ โโโ variables.css
โ โโโ media-queries.css
โ โโโ themes/ # Theme files (14 themes: 7 dark, 7 light)
โ โโโ dark/
โ โ โโโ github-dark-classic.css
โ โ โโโ shades-of-purple.css
โ โ โโโ sandstorm-classic.css
โ โ โโโ rocky-blood-orange.css
โ โ โโโ minimal-dark-neon-yellow.css
โ โ โโโ hack-the-box.css
โ โ โโโ pink-cat-boo.css
โ โโโ light/
โ โโโ github-light.css
โ โโโ red-velvet-cupcake.css
โ โโโ orangy-one-light.css
โ โโโ sunflower.css
โ โโโ green-breeze-light.css
โ โโโ cute-pink.css
โ โโโ semi-light-purple.css
โโโ docs/ # Documentation
โโโ public/ # Static assets
โ โโโ css/ # Generated CSS
โ โโโ main.min.css
โโโ scripts/ # Build scripts
โโโ build-css.js Development
Start the development server:
pnpm dev The site will be available at http://localhost:4321
Building
Build for production:
pnpm build This will:
- Build and minify CSS to
public/css/main.min.css - Build the Astro site to
dist/
Using Components
Rizzo CSS includes a comprehensive set of accessible components. Each component has its own dedicated documentation page with live examples, usage instructions, and API details. Every component page includes Astro | Vanilla | Svelte | Vue | React code tabs with complete, copy-paste examples. Interactive components (Navbar, Settings, Modal, Dropdown, Tabs, Accordion, Search, etc.) run their scripts after the DOM is ready, so they work when you import or copy them into your project. Search, Settings, and the Navbar mobile menu are fully keyboard-navigable (Tab, Escape, focus trap where applicable) and close when you click outside the panel or menu in all five frameworks.
Component Documentation
- Accordion - Collapsible sections with single/multiple open and keyboard navigation
- Alert - Alert/notification component with auto-dismiss
- Avatar - User avatar with image or initials fallback
- Badge - Small labels and tags with variants and sizes
- Breadcrumb - Navigation breadcrumbs with separator customization
- Button - Semantic button component
- Cards - Flexible card component
- Copy to Clipboard - Copy to clipboard component
- Docs Sidebar - Documentation sidebar navigation with grouped links and active state
- Divider - Horizontal or vertical divider with optional label
- Dropdown - Accessible dropdown menu with keyboard navigation and nested submenus
- Footer - Site footer with copyright and optional link list
- Font Switcher - Font pair (sans + mono) dropdown with preview
- Forms - Form components (FormGroup, Input, Textarea, Select, Checkbox, Radio)
- Icons - Reusable SVG icon components (same set for Astro, Svelte, React, Vue, Vanilla; includes Cmd icon)
- Modal - Accessible modal/dialog component
- Navbar - Responsive, accessible navigation bar
- Pagination - Pagination navigation with prev/next, page numbers, and ellipsis
- Progress Bar - Progress bar with variants, sizes, and indeterminate state
- Search - Search with Algolia on docs; package scaffold has overlay with header (search icon, input, close), sample results to edit, keyboard and click-outside to close
- Settings - Comprehensive settings panel
- Sound Effects - Toggle for play sound on click (Web Audio); off by default
- Spinner - Accessible loading spinner with variants and sizes
- Table - Data table with sorting and filtering
- Tabs - Accessible tabs component with keyboard navigation and ARIA tab pattern
- Theme Switcher - Accessible theme switcher
- Toast - Fixed position toast notifications
- Tooltip - Accessible tooltip component with positioning options
See the Components Documentation for an overview and links to all component pages.
Using Themes
Rizzo CSS includes 14 built-in themes (7 dark, 7 light). Themes are applied via the data-theme attribute on the HTML element:
<html lang="en" data-theme="github-dark-classic"> See Theming Documentation for more details.
CSS Architecture
File Organization
CSS is organized into logical files:
variables.css- Default theme variables and typography systemreset.css- Modern CSS resetbase.css- Base HTML element stylestypography.css- Typography system (font families, sizes, weights, line heights, utilities)accessibility.css- Accessibility utilitiesbuttons.css- Button component styleslayout.css- Layout utilitiesspacing.css- Margin and padding utility classessizes.css- Width, height, min/max dimensions, and container utilitiesutilities.css- Utility classes (colors, borders, focus states)forms.css- Form component stylespages.css- Page-specific stylesmedia-queries.css- Responsive breakpoints and media query definitionscomponents.css- Component styles (Accordion, Alert, Avatar, Badge, Breadcrumb, Card, CodeBlock, CopyToClipboard, Divider, Dropdown, Modal, Navbar, Pagination, Progress Bar, Search, Settings, Spinner, Table, Tabs, ThemeSwitcher, Toast, Tooltip)themes/- Theme definitions (dark/light)
Semantic Variables
All styles use semantic theme variables:
.my-component {
background-color: var(--background);
color: var(--text);
border: 1px solid var(--border);
} PostCSS Processing
- Development: PostCSS processes imports and adds vendor prefixes
- Production: CSS is minified via
build:cssscript - Linting: Stylelint configured for BEM naming convention
- No Inline Styles: All component styles are in external CSS files
Spacing Utilities
Rizzo CSS includes comprehensive spacing utilities for margins and padding:
<!-- Margin utilities -->
<div class="m-4">Margin on all sides</div>
<div class="mx-auto">Centered with auto margins</div>
<div class="mt-6 mb-4">Top and bottom margins</div>
<!-- Padding utilities -->
<div class="p-4">Padding on all sides</div>
<div class="px-6 py-4">Horizontal and vertical padding</div>
<!-- Sizes: 0, 1 (4px), 2 (8px), 3 (12px), 4 (16px), 5 (20px), 6 (24px), 8 (32px), 10 (40px), 12 (48px), 16 (64px), 20 (80px), 24 (96px) --> See Design System Documentation for available variables and utilities.