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.

npm pnpm yarn bun

Add to existing project:

Choose your package manager โ€” click a tab to select, then copy the command.

npm pnpm yarn bun

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.

npm pnpm yarn bun

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

  1. 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.
  2. Add to existing: Run npx rizzo-css add in your project root; add the printed <link> to your HTML.
  3. CSS: CLI writes css/rizzo.min.css. Link it or use a CDN (see README-RIZZO.md).
  4. Components: Same BEM classes as the Components docs. Core includes js/main.js for interactivity; see Vanilla component pages for copy-paste HTML.

Astro

  1. 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.
  2. Add to existing: npx rizzo-css add in the project root, or npm create astro@latest my-app && cd my-app && npx rizzo-css add. Add the printed <link> to your root layout.
  3. CSS: public/css/rizzo.min.css. In layout: <link rel="stylesheet" href="/css/rizzo.min.css" /> or import 'rizzo-css'.
  4. Components: Copied to e.g. src/components/rizzo/. Use same BEM as Components; layout includes theme and toast.

Svelte (SvelteKit)

  1. 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.
  2. Add to existing: npx rizzo-css add in the project root, or npm create svelte@latest my-app && cd my-app && npx rizzo-css add. Add the printed <link> to app.html.
  3. CSS: static/css/rizzo.min.css. In app.html: <link rel="stylesheet" href="/css/rizzo.min.css" />.
  4. Components: import { Button, Badge, Card, ... } from '$lib/rizzo'. See Svelte docs and component pages (Astro | Vanilla | Svelte | Vue | React tabs).

React

  1. 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.
  2. Add to existing: npx rizzo-css add in the project root. Add the printed <link> to your root layout or index.html.
  3. CSS: Same path as your framework (e.g. public/css/rizzo.min.css or src/styles/rizzo.min.css). Link in layout or import in app entry.
  4. Components: Scaffold copies React components to your project. See React component docs for live examples and TSX code blocks.

Vue

  1. 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.
  2. Add to existing: npx rizzo-css add in the project root. Add the printed <link> to your root layout or index.html.
  3. CSS: Same path as your framework. Link in layout or import in app entry.
  4. 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):

bash bash
# Clone the project
git clone <repository-url>
cd rizzo-css
bash bash
# Install dependencies
pnpm install

Project Structure

plaintext plaintext
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:

bash bash
pnpm dev

The site will be available at http://localhost:4321

Building

Build for production:

bash bash
pnpm build

This will:

  1. Build and minify CSS to public/css/main.min.css
  2. 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 html
<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 system
  • reset.css - Modern CSS reset
  • base.css - Base HTML element styles
  • typography.css - Typography system (font families, sizes, weights, line heights, utilities)
  • accessibility.css - Accessibility utilities
  • buttons.css - Button component styles
  • layout.css - Layout utilities
  • spacing.css - Margin and padding utility classes
  • sizes.css - Width, height, min/max dimensions, and container utilities
  • utilities.css - Utility classes (colors, borders, focus states)
  • forms.css - Form component styles
  • pages.css - Page-specific styles
  • media-queries.css - Responsive breakpoints and media query definitions
  • components.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:

css css
.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:css script
  • 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:

html html
<!-- 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.