# Bloum > A powerful library of modern web components for your design system. Bloum is a CSS-first UI component library for server-rendered multipage apps (Laravel, Django, Rails…), styled with plain CSS classes and enhanced with a small amount of vanilla JavaScript. It works well with htmx and Alpine.js and is not meant for React or Vue. Key facts: - Install with `npm install bloum` or from a CDN (`https://unpkg.com/bloum/dist/...`). Call `init()` (or `Bloum.init()` with the browser bundle) once the DOM is ready; it also re-initializes components on `htmx:load`. - Components are plain HTML with Bloum classes (`.btn`, `.modal`, `.input`…) or light-DOM custom elements (``, ``, ``). There is no shadow DOM. - `bloum.min.css` holds the tokens and component styles. `reset.min.css` and `utilities.min.css` are opt-in; with Tailwind CSS, load only `bloum.min.css`. - Theme by overriding the semantic `--bl-*` CSS variables (see Design tokens). Dark mode is enabled with the `.dark` class or `data-theme="dark"`. - Current version: 0.22.0. The complete documentation in one file is at https://www.bloum.dev/llms-full.txt. ## Docs - [Introduction to Bloum](https://www.bloum.dev/llms/docs/introduction.md) - [Getting Started](https://www.bloum.dev/llms/docs/getting-started.md) - [Components Overview](https://www.bloum.dev/llms/docs/components.md) - [Design Tokens](https://www.bloum.dev/llms/docs/design-tokens.md) - [Tailwind CSS Integration](https://www.bloum.dev/llms/docs/tailwindcss.md) - [Utilities](https://www.bloum.dev/llms/docs/utilities.md) ## Components - [Accordion](https://www.bloum.dev/llms/components/accordion.md): Collapsible sections that expand and collapse to show/hide content panels - [Alert](https://www.bloum.dev/llms/components/alert.md): Notification component that displays important messages with different severity levels - [Avatar](https://www.bloum.dev/llms/components/avatar.md): Circular or rounded display for user profile pictures or initials - [Badge](https://www.bloum.dev/llms/components/badge.md): Small status indicator or label that appears near other UI elements - [Breadcrumb](https://www.bloum.dev/llms/components/breadcrumb.md): Navigation aid showing the user's current location within a hierarchical structure - [Button](https://www.bloum.dev/llms/components/button.md): Interactive element that triggers actions when clicked or pressed - [Icon Button](https://www.bloum.dev/llms/components/icon-button.md) - [Calendar](https://www.bloum.dev/llms/components/calendar.md): Month view calendar that displays events, with localized navigation - [Card](https://www.bloum.dev/llms/components/card.md): Container component that groups related content with consistent styling - [Checkbox Card](https://www.bloum.dev/llms/components/checkbox-card.md): Card-style checkbox component for selection with enhanced visual presentation - [Checkbox](https://www.bloum.dev/llms/components/checkbox.md): Input components for single and multiple selection with customizable styling and states - [Collapse](https://www.bloum.dev/llms/components/collapse.md): Collapsible content component that can be expanded and collapsed - [Combobox](https://www.bloum.dev/llms/components/combobox.md): Input field that suggests and completes text as the user types - [Context Menu](https://www.bloum.dev/llms/components/context-menu.md): Right-click menu that provides contextual actions for specific elements - [Copy Button](https://www.bloum.dev/llms/components/copy-button.md): Button that copies text to the clipboard - [Drawer](https://www.bloum.dev/llms/components/drawer.md): Panel that slides in from the side of the screen over existing content - [Form Field](https://www.bloum.dev/llms/components/form-field.md): Wrapper component that provides consistent styling and layout for form inputs with labels and help text - [Input](https://www.bloum.dev/llms/components/input.md): Basic text input field for collecting user data - [Menu](https://www.bloum.dev/llms/components/menu.md): Menu that appears when triggered, showing a list of selectable options - [Modal](https://www.bloum.dev/llms/components/modal.md): Popup dialog that overlays the main content and requires user interaction - [Navbar](https://www.bloum.dev/llms/components/navbar.md): Top-mounted navigation menu with primary actions and links - [Pagination](https://www.bloum.dev/llms/components/pagination.md): Navigation controls for splitting large datasets across multiple pages - [Phone Input](https://www.bloum.dev/llms/components/phone-input.md): Phone number field with a country selector, formatted as the user types - [Pin Input](https://www.bloum.dev/llms/components/pin-input.md): Specialized input for one-time passwords with separate fields for each digit - [Popover](https://www.bloum.dev/llms/components/popover.md): Small overlay that appears near a trigger element with contextual content - [Progress](https://www.bloum.dev/llms/components/progress.md): Visual indicator showing completion status of tasks or processes - [Segmented Control](https://www.bloum.dev/llms/components/segmented-control.md): Group of buttons that represent different states or values - [Sidebar](https://www.bloum.dev/llms/components/sidebar.md): Side-mounted navigation menu with hierarchical structure - [Skeleton](https://www.bloum.dev/llms/components/skeleton.md): Loading placeholder that mimics the structure of content being loaded - [Spinner](https://www.bloum.dev/llms/components/spinner.md): Visual marker that shows status, progress, or active states - [Steps](https://www.bloum.dev/llms/components/steps.md): Progress indicator showing the current step in a multi-step process - [Switch](https://www.bloum.dev/llms/components/switch.md): Switch-style input for binary on/off states - [Table](https://www.bloum.dev/llms/components/table.md): Structured data display with rows, columns, sorting, and filtering capabilities - [Tabs](https://www.bloum.dev/llms/components/tabs.md): Horizontal navigation that switches between different content panels - [Tag](https://www.bloum.dev/llms/components/tag.md): Label for categorizing and organizing content - [Textarea](https://www.bloum.dev/llms/components/textarea.md): Multi-line text input field for longer content entry - [Timeline](https://www.bloum.dev/llms/components/timeline.md): Component that displays events or milestones in chronological order - [Toast](https://www.bloum.dev/llms/components/toast.md): Temporary notification that appears briefly to provide feedback - [Tooltip](https://www.bloum.dev/llms/components/tooltip.md): Brief informational popup that appears on hover after a short delay ## Optional - [Color Scheme Switcher (experimental)](https://www.bloum.dev/llms/components/color-scheme-switcher.md): Button that opens a dropdown menu with selectable color schemes - [Command Menu (experimental)](https://www.bloum.dev/llms/components/command-menu.md): Searchable command interface activated by keyboard shortcuts - [Data Table (experimental)](https://www.bloum.dev/llms/components/data-table.md): Advanced data table component with enhanced functionality for large datasets - [Storybook](https://docs.bloum.dev): Interactive demos of every component - [Source code](https://github.com/balsigergil/bloum): GitHub repository ---

Bloum Logo

# Introduction to Bloum Welcome to **Bloum**, a modern web components library designed to help you build beautiful, accessible user interfaces with ease. ## What is Bloum? Bloum is an open-source collection of web components that provides everything you need to create a design system for modern web applications. Whether you're building a simple website or a complex web application, Bloum offers a comprehensive set of UI components that work seamlessly across different frameworks and environments. ### Key Features - πŸš€ **Feature-rich:** A wide range of components to build modern web apps or design systems. - πŸͺΆ **Lightweight:** Less than 30KB minified and gzipped. - πŸ” **Accessible:** Built with accessibility in mind, fully keyboard-navigable and [WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/) compliant. - πŸŒ“ **Dark mode:** Supports dark mode out of the box. - πŸ“± **Responsive:** Works on all modern browsers and devices. - πŸ“¦ **No dependencies:** Works standalone, with no CSS framework required, easy Tainwind integration. - 🎨 **Theming:** Easy to customize with CSS variables. ## Who is Bloum for? Bloum is perfect for: - **Full-stack developers** using server-side frameworks like Laravel, Django, Rails, or any other full-stack framework - **Frontend developers** who want pre-built, accessible components - **Teams** looking for a consistent design system - **Projects** that use progressive enhancement with tools like HTMX or Alpine.js ## Getting Started Ready to start using Bloum? Check out our [Getting Started Guide](https://www.bloum.dev/llms/docs/getting-started.md) to get up and running in minutes. ## Support - **GitHub**: [Report issues or contribute](https://github.com/balsigergil/bloum) - **License**: MIT License - free for personal and commercial use --- Built with ❀️ by [Gil Balsiger](https://github.com/balsigergil) --- # Getting Started ## Choose your setup Bloum ships its CSS as three separate stylesheets. Which ones you load depends on whether your project already uses Tailwind CSS. | Stylesheet | Standalone | With Tailwind | Contains | | :------------------ | :--------- | :------------ | :------------------------------------------- | | `reset.min.css` | βœ… Yes | ❌ No | Cross-browser normalization | | `bloum.min.css` | βœ… Yes | βœ… Yes | Design tokens and all component styles | | `utilities.min.css` | βœ… Yes | ❌ No | Layout helpers (flex, grid, spacing, sizing) | **Standalone** β€” Bloum has no dependency on Tailwind. The reset gives you the same normalization a utility framework's preflight would, and the utilities give you just enough layout classes to arrange components without pulling in a whole framework. **With Tailwind** β€” load only `bloum.min.css`. Tailwind's preflight already covers the reset, and Tailwind's own utilities already cover the helpers, so the other two files are redundant. See [Tailwind CSS](https://www.bloum.dev/llms/docs/tailwindcss.md) for details. ## Installation ### CDN The fastest way to get started. Add the following to your HTML `` tag: ```html ``` If you already use Tailwind, keep only the middle stylesheet: ```html ``` `bloum.bundle.min.js` is a self-contained browser build that exposes a global `Bloum` object. Call `init()` on it once the DOM is ready to register all components: ```html ``` > **Note:** For production, pin a specific version to avoid unexpected breaking > changes β€” replace `bloum` with `bloum@0.0.1` in each URL above _(using the > latest version number)_. ### Package Manager For projects using a build tool, install Bloum with your favorite package manager: ```bash # NPM npm install bloum # Yarn yarn add bloum # Pnpm pnpm add bloum # Bun bun add bloum ``` ## Usage ### 1. Import Styles In your application's entry point, import the stylesheets for your setup. **Standalone (no Tailwind)** β€” import all three: ```js import "bloum/dist/reset.min.css"; import "bloum/dist/bloum.min.css"; import "bloum/dist/utilities.min.css"; ``` **With Tailwind** β€” import only Bloum's core stylesheet, after Tailwind: ```js import "tailwindcss"; import "bloum/dist/bloum.min.css"; ``` Bloum's styles are organized with native CSS layers (`@layer theme, base, components, utilities`), so the cascade stays predictable regardless of import order. The order above is the one Bloum's own Storybook environment uses, and the one we develop against. ### 2. Initialize Bloum Import the `init` function and call it to register all components globally: ```js import { init } from "bloum"; init(); ``` ### 3. Use Components Now you can use the components in your HTML. Here is a simple example to verify your installation: ```html ``` If you see a styled button, congratulations! You are ready to build. ## Using Bloum with AI assistants Bloum publishes its documentation in the [llms.txt](https://llmstxt.org) format, generated from these docs and the component stories: - [`https://www.bloum.dev/llms.txt`](https://www.bloum.dev/llms.txt) β€” an index linking to one Markdown page per doc and per component. - [`https://www.bloum.dev/llms-full.txt`](https://www.bloum.dev/llms-full.txt) β€” the whole documentation in a single file. The same files ship in the npm package (`node_modules/bloum/dist/llms.txt`, `llms-full.txt` and `llms/`), matching the version you installed. ## Upgrading from an earlier version Earlier releases bundled a reset and a handful of helper classes directly into `bloum.css`. Both are now separate, opt-in stylesheets. If you are upgrading and are **not** using Tailwind, add the two new imports: ```js import "bloum/dist/reset.min.css"; // new import "bloum/dist/bloum.min.css"; import "bloum/dist/utilities.min.css"; // new ``` In particular, `sr-only`, `text-light`, `hstack` and `vstack` moved out of `bloum.css` and now live in `utilities.min.css`. ## Next Steps Now that you have Bloum installed, you can explore: - **[Components](https://www.bloum.dev/llms/docs/components.md):** Browse the full list of available components. - **[Utilities](https://www.bloum.dev/llms/docs/utilities.md):** The layout classes available in standalone mode. - **[Design Tokens](https://www.bloum.dev/llms/docs/design-tokens.md):** Learn how to customize the design system using CSS variables. --- # Components Overview This page provides a comprehensive overview of all available components in Bloum, organized by category. Each component includes its current implementation status and links to detailed documentation. ## Elements | Component | Description | Status | Documentation | | --------------------- | -------------------------------------------------------------------------------------- | -------------- | -------------------------------------------------------------- | | Accordion | Collapsible sections that expand and collapse to show/hide content panels | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/accordion.md) | | Alert | Notification component that displays important messages with different severity levels | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/alert.md) | | Avatar | Circular or rounded display for user profile pictures or initials | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/avatar.md) | | Badge | Small status indicator or label that appears near other UI elements | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/badge.md) | | Button | Interactive element that triggers actions when clicked or pressed | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/button.md) | | Split Button | Button that opens a dropdown menu with selectable options | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/button.md) | | Button Group | Group of buttons that share a common purpose or action | ⏳ Planned | - | | Toggle Button | Button that switches between two states (on/off or active/inactive) | ⏳ Planned | - | | Copy Button | Button that copies text to the clipboard | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/copy-button.md) | | Breadcrumb | Navigation aid showing the user's current location within a hierarchical structure | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/breadcrumb.md) | | Carousel | Slideshow component that cycles through multiple content items | ⏳ Planned | - | | Chat Bubble | Speech bubble-styled container for displaying chat messages | ⏳ Planned | - | | Menu | Menu that appears when triggered, showing a list of selectable options | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/menu.md) | | Spinner | Visual marker that shows status, progress, or active states | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/spinner.md) | | Panel Splitter | Resizable divider that allows users to adjust the size of adjacent panels | ⏳ Planned | - | | Keyboard Key | Visual representation of keyboard keys for shortcuts or instructions | ⏳ Planned | - | | Tag | Label for categorizing and organizing content | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/tag.md) | | Progress | Visual indicator showing completion status of tasks or processes | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/progress.md) | | Timeline | Component that displays events or milestones in chronological order | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/timeline.md) | | Color Scheme Switcher | Button that opens a dropdown menu with selectable color schemes | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/color-scheme-switcher.md) | | Collapse | Collapsible content component that can be expanded and collapsed | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/collapse.md) | ## Inputs | Component | Description | Status | Documentation | | --------------------- | ------------------------------------------------------------------------------------------------------- | -------------- | ----------------------------------------------------------------------- | | Combobox | Input field that suggests and completes text as the user types | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/combobox.md) | | Color Picker | Interface for selecting colors using various input methods (palette, sliders, etc.) | ⏳ Planned | - | | Pin Input | Specialized input for one-time passwords with separate fields for each digit | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/pin-input.md) | | Phone Input | Phone number field with a country selector, formatted as the user types | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/phone-input.md) | | Date Picker | Calendar-based interface for selecting dates and date ranges | ⏳ Planned | - | | Rich Text Editor | WYSIWYG editor with formatting tools for creating styled content | ⏳ Planned | - | | Input | Basic text input field for collecting user data | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/input.md) | | Input Mask | Input field with predefined format patterns (phone numbers, dates, etc.) | ⏳ Planned | - | | Knob | Circular control for selecting values by rotating a dial interface | ⏳ Planned | - | | Password Indicator | Visual feedback component showing password strength and requirements | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/input.md) | | Textarea | Multi-line text input field for longer content entry | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/textarea.md) | | Select | Dropdown component for choosing from a list of predefined options | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/input.md) | | Checkbox / Radio | Input components for single and multiple selection with customizable styling and states | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/checkbox.md) | | Checkbox / Radio Card | Card-style checkbox component for selection with enhanced visual presentation | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/checkbox-card.md) | | Switch | Switch-style input for binary on/off states | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/switch.md) | | Segmented Control | Group of buttons that represent different states or values | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/segmented-control.md) | | Range | Slider input for selecting numeric values within a specified range | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/input.md) | | Rating | Star or icon-based input for collecting user ratings or reviews | ⏳ Planned | - | | File Input | Component for uploading and selecting files from the user's device | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/input.md) | | Form Field | Wrapper component that provides consistent styling and layout for form inputs with labels and help text | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/form-field.md) | ## Navigation | Component | Description | Status | Documentation | | ------------ | ---------------------------------------------------------------------- | -------------- | --------------------------------------------------------------- | | Bottom Tabs | Tab navigation positioned at the bottom of the screen or container | ⏳ Planned | - | | Command Menu | Searchable command interface activated by keyboard shortcuts | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/command-menu.md) | | Pagination | Navigation controls for splitting large datasets across multiple pages | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/pagination.md) | | Steps | Progress indicator showing the current step in a multi-step process | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/steps.md) | | Tabs | Horizontal navigation that switches between different content panels | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/tabs.md) | | Sidebar | Side-mounted navigation menu with hierarchical structure | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/sidebar.md) | | Navbar | Top-mounted navigation menu with primary actions and links | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/navbar.md) | ## Overlays | Component | Description | Status | Documentation | | ------------ | ------------------------------------------------------------------------- | -------------- | --------------------------------------------------------------- | | Modal | Popup dialog that overlays the main content and requires user interaction | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/modal.md) | | Drawer | Panel that slides in from the side of the screen over existing content | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/drawer.md) | | Popover | Small overlay that appears near a trigger element with contextual content | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/popover.md) | | Tooltip | Brief informational popup that appears on hover after a short delay | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/tooltip.md) | | Context Menu | Right-click menu that provides contextual actions for specific elements | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/context-menu.md) | | Toast | Temporary notification that appears briefly to provide feedback | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/toast.md) | | Tour | Guided walkthrough component that highlights and explains UI features | ❌ Not planned | Use [Sheperd](https://www.shepherdjs.dev/) | ## Layout | Component | Description | Status | Documentation | | --------- | ----------------------------------------------------------------------- | -------------- | --------------------------------------------------------- | | Card | Container component that groups related content with consistent styling | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/card.md) | | Container | Wrapper component that provides consistent spacing and maximum width | ⏳ Planned | - | | Skeleton | Loading placeholder that mimics the structure of content being loaded | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/skeleton.md) | ## Data | Component | Description | Status | Documentation | | ------------------------- | ------------------------------------------------------------------------------- | -------------- | ------------------------------------------------------- | | Table | Structured data display with rows, columns, sorting, and filtering capabilities | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/table.md) | | Data Table | Advanced data table component with enhanced functionality for large datasets | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/data-table.md) | | Calendar | Month view calendar that displays events, with localized navigation | βœ… Implemented | [View Docs](https://www.bloum.dev/llms/components/calendar.md) | | Order List | Sortable list component where items can be reordered by dragging | ⏳ Planned | - | | Tree | Hierarchical data structure with expandable/collapsible nodes | ⏳ Planned | - | | Pick List / Transfer List | Dual-panel component for moving items between available and selected lists | ⏳ Planned | - | --- # Design Tokens Bloum uses a comprehensive system of CSS custom properties (design tokens) to maintain consistency across the UI. These tokens control colors, typography, spacing, and more. You can override these variables to customize the look and feel of your application. ## Colors Bloum includes a predefined color palette with multiple shades (50-950) for each color. ### Semantic Colors These colors are used throughout the components to convey meaning. They are mapped to specific colors from the palette by default but can be customized. | Token Name | Default Mapping | Description | | :------------------------- | :-------------- | :----------------------------------- | | `--bl-clr-primary-{shade}` | Blue | Main brand color | | `--bl-clr-success-{shade}` | Green | Success states and feedback | | `--bl-clr-warning-{shade}` | Orange | Warning states and alerts | | `--bl-clr-danger-{shade}` | Red | Error states and destructive actions | | `--bl-clr-info-{shade}` | Sky | Informational messages | **Usage:** ```css .my-element { background-color: var(--bl-clr-primary-500); color: var(--bl-clr-primary-50); } ``` ### Contextual Colors These tokens are used for general layout elements like text and backgrounds. They automatically adjust for dark mode. | Token Name | Light Mode Value | Dark Mode Value | Description | | :----------------------------- | :--------------- | :----------------------- | :------------------------------------ | | `--bl-clr-background` | `white` | `gray-900` | Page background | | `--bl-clr-surface` | `white` | `gray-800` | Component backgrounds (cards, modals) | | `--bl-clr-text` | `gray-700` | `gray-200` | Primary text color | | `--bl-clr-text-light` | `gray-500` | `gray-400` | Secondary/lighter text color | | `--bl-clr-text-inverted` | `gray-200` | `gray-700` | Text on dark backgrounds | | `--bl-clr-text-light-inverted` | `gray-400` | `gray-500` | Muted text on dark backgrounds | | `--bl-border-color` | `gray-200` | `gray-700` (50% opacity) | Default border color | | `--bl-clr-text-danger` | `danger-600` | `danger-400` | Text of destructive items | | `--bl-clr-hover-bg-danger` | `danger-50` | `danger-950` | Hover background of destructive items | ### Color Palette Bloum ships its own copy of a Tailwind-compatible color palette β€” the values are bundled in `bloum.css`, so **Tailwind is not required** to use them. It provides the following color ranges: - **Reds & Pinks:** `red`, `rose`, `pink`, `fuchsia` - **Purples:** `purple`, `violet`, `indigo` - **Blues:** `blue`, `sky`, `cyan` - **Greens & Teals:** `teal`, `emerald`, `green`, `lime` - **Yellows & Oranges:** `yellow`, `amber`, `orange` - **Grays:** `slate`, `gray`, `zinc`, `neutral`, `stone` - **Base:** `black`, `white` Each color ranges from `50` (lightest) to `950` (darkest). Example: `--bl-clr-blue-500` ## Typography ### Font Families | Token Name | Value | Description | | :---------------- | :--------------------------- | :---------------------- | | `--bl-font-sans` | System UI / Sans-serif stack | Default sans-serif font | | `--bl-font-serif` | Georgia / Serif stack | Serif font | | `--bl-font-mono` | Monospace stack | Monospace font for code | | `--bl-font-body` | `var(--bl-font-sans)` | Main body font | ### Font Sizes Bloum sets `html { font-size: 87.5% }` (14px with the browser's default setting), and every `rem` in Bloum (text, spacing, control sizes) scales from it. Override it once to rescale the whole interface: ```css html { font-size: 100%; /* 16px base */ } ``` The size steps are ratios of the 14px base, so they land on whole pixels at the default root size. | Token Name | Value (default) | Definition | | :------------- | :-------------- | :--------------------- | | `--bl-fs-xs` | 10px | `calc(10 / 14 * 1rem)` | | `--bl-fs-sm` | 12px | `calc(12 / 14 * 1rem)` | | `--bl-fs-base` | 14px | `1rem` | | `--bl-fs-lg` | 16px | `calc(16 / 14 * 1rem)` | | `--bl-fs-xl` | 18px | `calc(18 / 14 * 1rem)` | | `--bl-fs-2xl` | 20px | `calc(20 / 14 * 1rem)` | | `--bl-fs-3xl` | 24px | `calc(24 / 14 * 1rem)` | | `--bl-fs-4xl` | 30px | `calc(30 / 14 * 1rem)` | | `--bl-fs-5xl` | 36px | `calc(36 / 14 * 1rem)` | | `--bl-fs-6xl` | 48px | `calc(48 / 14 * 1rem)` | | `--bl-fs-7xl` | 60px | `calc(60 / 14 * 1rem)` | | `--bl-fs-8xl` | 72px | `calc(72 / 14 * 1rem)` | | `--bl-fs-9xl` | 96px | `calc(96 / 14 * 1rem)` | ### Font Weights | Token Name | Value | | :--------------- | :---- | | `--bl-fw-medium` | 600 | | `--bl-fw-bold` | 700 | ### Line Height Line height of single-line text in controls (buttons, inputs, tabs, table cells, list items). | Token Name | Value (default) | Definition | | :------------- | :-------------- | :--------------------- | | `--bl-lh-base` | 20px | `calc(20 / 14 * 1rem)` | ## Spacing & Layout ### Border Radius | Token Name | Value | | :------------------------ | :------- | | `--bl-border-radius` | 0.25rem | | `--bl-border-radius-md` | 0.375rem | | `--bl-border-radius-lg` | 0.5rem | | `--bl-border-radius-xl` | 0.75rem | | `--bl-border-radius-2xl` | 1rem | | `--bl-border-radius-full` | 9999px | ### Breakpoints | Token Name | Value | | :-------------------- | :----- | | `--bl-breakpoint-sm` | 640px | | `--bl-breakpoint-md` | 768px | | `--bl-breakpoint-lg` | 1024px | | `--bl-breakpoint-xl` | 1280px | | `--bl-breakpoint-2xl` | 1536px | ## Effects ### Shadows | Token Name | Description | | :--------------- | :----------------- | | `--bl-shadow-sm` | Small shadow | | `--bl-shadow` | Default shadow | | `--bl-shadow-lg` | Large shadow | | `--bl-shadow-xl` | Extra large shadow | ### Transitions | Token Name | Duration | | :------------------- | :------- | | `--bl-transition-xs` | 50ms | | `--bl-transition-sm` | 100ms | | `--bl-transition-md` | 150ms | | `--bl-transition-lg` | 200ms | | `--bl-transition-xl` | 300ms | ### Focus Ring | Token Name | Value | | :---------------------- | :------------------------------------------- | | `--bl-focus-color` | `primary-400` (Light) / `primary-600` (Dark) | | `--bl-focus-width` | 0.2rem | | `--bl-focus-fade` | 50% | | `--bl-focus-transition` | 150ms | ### Z-Index Stacking order for layered components. Override these if Bloum's overlays need to sit above (or below) something else in your app. | Token Name | Value | | :---------------- | :---- | | `--bl-z-topbar` | 50 | | `--bl-z-sidebar` | 60 | | `--bl-z-modal` | 100 | | `--bl-z-drawer` | 100 | | `--bl-z-popover` | 200 | | `--bl-z-dropdown` | 200 | | `--bl-z-tooltip` | 200 | | `--bl-z-toast` | 300 | ### Miscellaneous | Token Name | Value | Description | | :---------------------- | :---- | :----------------------------------- | | `--bl-disabled-opacity` | 0.7 | Opacity applied to disabled elements | | `--bl-spinner-speed` | 0.5s | Spinner rotation duration | ## Form Tokens Specific tokens for form inputs: | Token Name | Light Mode Value | Dark Mode Value | | :------------------------- | :---------------------- | :-------------- | | `--bl-input-height` | 2.25rem | _Same_ | | `--bl-input-padding` | 0.625rem | _Same_ | | `--bl-input-bg` | `var(--bl-clr-surface)` | _Same_ | | `--bl-input-border-color` | `gray-300` | `gray-600` | | `--bl-input-border-radius` | `md` | _Same_ | ## List Item Tokens Shared by menu items and combobox options, so both lists have the same height (32px, 40px on touch screens via `@media (pointer: coarse)`): | Token Name | Value | Description | | :--------------------------- | :------------------- | :------------------------ | | `--bl-list-item-padding-x` | 8px | Horizontal padding | | `--bl-list-item-padding-y` | 6px (10px on touch) | Vertical padding | | `--bl-list-item-line-height` | `--bl-lh-base` | Line height of the item | | `--bl-list-item-radius` | `--bl-border-radius` | Corner radius of the item | --- # Tailwind CSS Integration Bloum does not depend on Tailwind β€” but it is designed to pair with it. Bloum provides the components as building blocks to make your UI, while Tailwind provides the utility classes to glue everything together. ## Installation Integrating Tailwind requires no specific configuration for Bloum. Follow the official setup instructions from the Tailwind team: [**Install Tailwind CSS**](https://tailwindcss.com/docs/installation) ### Import only the core stylesheet This is the one rule that matters. With Tailwind, import **only** `bloum.min.css`: ```js import "tailwindcss"; import "bloum/dist/bloum.min.css"; ``` Do **not** import `bloum/dist/reset.min.css` or `bloum/dist/utilities.min.css`. Both exist for projects running Bloum standalone, and both duplicate what Tailwind already gives you: | Bloum stylesheet | Why you skip it with Tailwind | | :------------------ | :------------------------------------------------------------------- | | `reset.min.css` | It is a port of Tailwind's Preflight β€” you already have the original. | | `utilities.min.css` | Tailwind's utilities supersede it, with far broader coverage. | Loading them anyway is wasteful but not harmful: Bloum's utilities are declared inside `@layer utilities`, so your real Tailwind classes still win the cascade. ## Customizing Colors Bloum ships its own copy of the Tailwind color palette, so the default theme matches a stock Tailwind project out of the box. If you use the default Tailwind colors, no further action is needed. If you have defined **custom colors** in your Tailwind theme, you will likely want Bloum's components to reflect them. Bloum exposes semantic CSS variables (e.g. `--bl-clr-primary-500`) that you can point at your own values. ### Example: Using the Indigo Color from Tailwind For example, if you want your **Primary** color to be `indigo` instead of the default `blue`: ```css :root { --bl-clr-primary-50: var(--color-indigo-50); --bl-clr-primary-100: var(--color-indigo-100); --bl-clr-primary-200: var(--color-indigo-200); --bl-clr-primary-300: var(--color-indigo-300); --bl-clr-primary-400: var(--color-indigo-400); --bl-clr-primary-500: var(--color-indigo-500); --bl-clr-primary-600: var(--color-indigo-600); --bl-clr-primary-700: var(--color-indigo-700); --bl-clr-primary-800: var(--color-indigo-800); --bl-clr-primary-900: var(--color-indigo-900); --bl-clr-primary-950: var(--color-indigo-950); } ``` The same works for a color you defined yourself. In Tailwind v4, theme values are declared in CSS with `@theme`, and every entry becomes a custom property you can reference directly: ```css @import "tailwindcss"; @theme { --color-brand-500: oklch(0.62 0.19 260); /* ...remaining shades... */ } :root { --bl-clr-primary-500: var(--color-brand-500); /* ...remaining shades... */ } ``` See [Design Tokens](https://www.bloum.dev/llms/docs/design-tokens.md) for the full list of variables you can override. --- # Utilities Bloum ships a small, optional set of layout utility classes in a separate stylesheet: ```js import "bloum/dist/utilities.min.css"; ``` **This file is opt-in and is not imported by `bloum.css`.** Core Bloum ships with zero layout utilities, so projects that already use Tailwind hit no class-name conflicts. > **Using Tailwind?** Skip this stylesheet entirely β€” Tailwind's utilities cover > everything here and much more. See > [Tailwind CSS](https://www.bloum.dev/llms/docs/tailwindcss.md). The goal is not to reimplement a utility framework. It is to give standalone projects just enough classes to lay out Bloum components without adding a build step. Class names follow Tailwind's conventions, and everything is declared inside `@layer utilities`, so if Tailwind is ever loaded alongside, Tailwind wins the cascade. ## The spacing scale Numeric steps map to `step Γ— 0.25rem` β€” so `4` is `1rem`. Every family below exposes the same complete scale, rather than a cherry-picked subset: ``` 0 1 2 3 4 5 6 8 10 12 16 ``` | Class | Value | | :----- | :-------- | | `p-0` | `0` | | `p-1` | `0.25rem` | | `p-2` | `0.5rem` | | `p-4` | `1rem` | | `p-8` | `2rem` | | `p-16` | `4rem` | This scale is shared by **margin**, **padding**, **gap** and **space**. The sizing utilities (`w-*`, `h-*`, `size-*`) extend it with three larger steps β€” `20`, `24` and `32`. ## Layout | Family | Classes | | :----------- | :------------------------------------------------------------------------------------- | | Display | `block`, `inline-block`, `flex`, `inline-flex`, `grid`, `hidden` | | Position | `relative`, `absolute`, `fixed`, `sticky` | | Flex | `flex-row`, `flex-col`, `flex-wrap`, `flex-1`, `grow`, `grow-0`, `shrink-0` | | Align | `items-start`, `items-center`, `items-end`, `items-baseline` | | Justify | `justify-start`, `justify-center`, `justify-end`, `justify-between` | | Grid | `grid-cols-1` … `grid-cols-6`, `col-span-1` … `col-span-6`, `col-span-full` | | Place | `place-items-center` | | Gap | `gap-*`, `gap-x-*`, `gap-y-*` | | Container | `container` (full width, centered, capped at each breakpoint) | ### Stack shorthands Two convenience classes cover the most common flex arrangements: ```html
``` ## Spacing | Family | Classes | | :------------- | :----------------------------------------------------------------- | | Margin | `m-*`, `mx-*`, `my-*`, `mt-*`, `mr-*`, `mb-*`, `ml-*`, `m-auto` | | Negative margin | `-mt-*`, `-mr-*`, `-mb-*`, `-ml-*` | | Padding | `p-*`, `px-*`, `py-*`, `pt-*`, `pr-*`, `pb-*`, `pl-*` | | Space between | `space-x-*`, `space-y-*` (applies to children, not the element) | ## Sizing | Family | Classes | | :---------- | :------------------------------------------------------------- | | Width | `w-*`, plus `w-px`, `w-auto`, `w-full`, `w-screen` | | Height | `h-*`, plus `h-px`, `h-auto`, `h-full`, `h-screen` | | Square | `size-*` (sets width and height together) | | Max width | `max-w-sm` … `max-w-7xl`, `max-w-full`, `max-w-none` | | Min size | `min-w-0`, `min-w-full`, `min-h-0`, `min-h-full` | ## Typography Font sizes map to Bloum's design tokens, so `text-lg` resolves to `var(--bl-fs-lg)` and stays in sync if you override the token. | Family | Classes | | :---------- | :-------------------------------------------------------------------------- | | Size | `text-xs` … `text-9xl` | | Weight | `font-normal`, `font-medium`, `font-semibold`, `font-bold` | | Leading | `leading-none`, `leading-tight`, `leading-snug`, `leading-normal`, `leading-relaxed`, `leading-loose` | | Tracking | `tracking-tighter`, `tracking-tight`, `tracking-normal`, `tracking-wide`, `tracking-wider`, `tracking-widest` | | Alignment | `text-center`, `text-balance` | | Overflow | `truncate` | | Transform | `uppercase` | | Lists | `list-disc`, `list-inside` | ## Colors Color utilities are semantic β€” they reference Bloum's tokens rather than raw palette values, so they follow your theme and adapt to dark mode automatically. | Family | Classes | | :--------- | :---------------------------------------------------------------------------- | | Text | `text-primary`, `text-success`, `text-warning`, `text-danger`, `text-info` | | Muted text | `text-light`, `text-muted` (both map to `--bl-clr-text-light`) | | Background | `bg-primary`, `bg-success`, `bg-warning`, `bg-danger`, `bg-info` | | Surfaces | `bg-surface`, `bg-muted` | ## Borders & effects | Family | Classes | | :------- | :----------------------------------------------------------------------------------- | | Radius | `rounded-none`, `rounded`, `rounded-md`, `rounded-lg`, `rounded-xl`, `rounded-2xl`, `rounded-full` | | Border | `border-l` | | Cursor | `cursor-pointer` | ## Accessibility `sr-only` visually hides an element while keeping it available to screen readers: ```html ``` ## Responsive variants Responsive coverage is intentionally narrow β€” utilities are **not** fanned out across every breakpoint. Only the layout variants needed to make a page responsive are provided: | Prefix | Min-width | Available variants | | :----- | :-------- | :------------------------------------------ | | `sm:` | 640px | `flex`, `hidden`, `grid-cols-1` … `grid-cols-6` | | `md:` | 768px | `flex`, `hidden`, `grid-cols-1` … `grid-cols-6` | | `lg:` | 1024px | `flex`, `hidden`, `grid-cols-1` … `grid-cols-6` | | `xl:` | 1280px | `container` cap only | | `2xl:` | 1536px | `container` cap only | ```html
...
``` If you need broader responsive coverage, that is the point at which reaching for Tailwind makes sense. ## Dark mode variants Two display variants are available for light/dark asset swaps: ```html Logo ``` These key off a `.dark` class or `[data-theme="dark"]` attribute on an **ancestor** element β€” not the `prefers-color-scheme` media query β€” so they follow whatever theme your app has explicitly applied. --- # Accordion > Collapsible sections that expand and collapse to show/hide content panels Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-accordion--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-accordion-header-color: var(--bl-clr-text); ``` ## Examples ### Accordion ```html
This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.
``` --- # Alert > Notification component that displays important messages with different severity levels Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-alert--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-alert-bg: var(--bl-clr-surface); --bl-alert-border: var(--bl-border-color-strong); --bl-alert-color: var(--bl-clr-text); --bl-alert-accent-width: 4px; --bl-alert-padding: 0.75rem; ``` ## Examples ### Alert ```html
Alert Title
This is an alert message.
``` ### Simple Alert ```html
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores earum fugiat laborum nisi perferendis quibusdam. Consequuntur, delectus danger est illum incidunt ipsam, laudantium nesciunt optio recusandae sapiente suscipit veniam vero!
``` ## Options Markup for each value of the Storybook controls. ### `color` ```html
Alert Title
This is an alert message.
Alert Title
This is an alert message.
Alert Title
This is an alert message.
Alert Title
This is an alert message.
Alert Title
This is an alert message.
``` --- # Avatar > Circular or rounded display for user profile pictures or initials Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-avatar--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-avatar-size: 2.5rem; --bl-avatar-fs: var(--bl-fs-lg); --bl-avatar-bg: var(--bl-clr-control-bg); --bl-avatar-color: var(--bl-clr-text); --bl-avatar-border-color: var(--bl-border-color-strong); --bl-avatar-border-width: 0; ``` ## Examples ### Default ```html
JD
``` ### With Image ```html
John Doe
``` ### Initials Only ```html
AB
``` ### Sizes ```html
XS
SM
MD
LG
XL
``` ### Variants ```html
AB
CD
EF
GH
``` ### With Images ```html
John Doe
Jean FranΓ§ois
Mike Johnson
``` ### With Badge ```html
JD
3
``` ### Badge Examples ```html
AB
3
Jean FranΓ§ois
CD
12
John Doe
``` ### Java Script API ```html

JavaScript API Usage

These avatars are initialized automatically using data attributes:
data-avatar - Enables auto-initialization
data-avatar-src - Image source URL
data-avatar-alt - Image alt text
data-avatar-initials - Fallback initials
data-avatar-size - Size variant (xs, sm, md, lg, xl)
data-avatar-variant - Style variant (default, solid, outline, subtle)
``` ## Options Markup for each value of the Storybook controls. ### `size` ```html
JD
JD
JD
JD
JD
``` ### `variant` ```html
JD
JD
JD
JD
``` ### `showBadge` ```html
JD
3
``` ### `badgeType` ```html
JD
JD
JD
JD
JD
JD
``` --- # Badge > Small status indicator or label that appears near other UI elements Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-badge--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-badge-bg: var(--bl-clr-background-inverted); --bl-badge-color: var(--bl-clr-text-inverted); --bl-badge-border-color: var(--bl-clr-background); --bl-badge-height: round(1.25rem, 2px); --bl-badge-dot-size: round(0.75rem, 2px); --bl-badge-fs: var(--bl-fs-sm); --bl-badge-fw: var(--bl-fw-bold); ``` ## Examples ### Badge ```html ``` ### Badge Top Right ```html ``` ### Badge Dot ```html ``` ## Options Markup for each value of the Storybook controls. ### `type` ```html ``` ### `topRight` ```html ``` ### `dot` ```html ``` ### `ping` ```html ``` --- # Breadcrumb > Navigation aid showing the user's current location within a hierarchical structure Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-breadcrumb--docs ## Examples ### Breadcrumb ```html ``` ### Breadcrumb With Icons ```html ``` ### Breadcrumb With Menu ```html ``` --- # Button > Interactive element that triggers actions when clicked or pressed Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-button--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-btn-color: var(--bl-clr-text); --bl-btn-bg: var(--bl-clr-control-bg); --bl-btn-hover-bg: hsl(from var(--bl-btn-bg) h s calc(l - 4)); --bl-btn-active-bg: hsl(from var(--bl-btn-hover-bg) h s calc(l - 4)); --bl-btn-border-radius: var(--bl-border-radius); --bl-btn-border: solid var(--bl-border-width) transparent; --bl-btn-height: 2.25rem; --bl-btn-outline-color: var(--bl-clr-primary-600); --bl-btn-fs: var(--bl-fs-base); --bl-btn-fw: var(--bl-fw-medium); --bl-btn-spinner-size: calc(1 / 2.25 * var(--bl-btn-height)); ``` ## Examples ### Primary ```html ``` ### Secondary ```html ``` ### Split ```html
``` ### Link ```html I'm a link ``` ## Options Markup for each value of the Storybook controls. ### `color` ```html ``` ### `variant` ```html ``` ### `size` ```html ``` ### `loading` ```html ``` ### `disabled` ```html ``` --- # Icon Button Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-icon-button--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-btn-color: var(--bl-clr-text); --bl-btn-bg: var(--bl-clr-control-bg); --bl-btn-hover-bg: hsl(from var(--bl-btn-bg) h s calc(l - 4)); --bl-btn-active-bg: hsl(from var(--bl-btn-hover-bg) h s calc(l - 4)); --bl-btn-border-radius: var(--bl-border-radius); --bl-btn-border: solid var(--bl-border-width) transparent; --bl-btn-height: 2.25rem; --bl-btn-outline-color: var(--bl-clr-primary-600); --bl-btn-fs: var(--bl-fs-base); --bl-btn-fw: var(--bl-fw-medium); --bl-btn-spinner-size: calc(1 / 2.25 * var(--bl-btn-height)); ``` ## Examples ### Primary ```html ``` ### Outline ```html ``` ## Options Markup for each value of the Storybook controls. ### `color` ```html ``` ### `variant` ```html ``` ### `size` ```html ``` ### `loading` ```html ``` ### `disabled` ```html ``` --- # Calendar > Month view calendar that displays events, with localized navigation Interactive demo: https://docs.bloum.dev/?path=/docs/components-data-calendar--docs A month view calendar that displays events. Multi-day events are shown as bars spanning their days, timed events with their start time. When a day has more events than fit, its last row becomes a "+N more" button that opens a popover listing every event of that day. The calendar is read-only. ## Usage Provide the events as JSON inside the element, which suits server-rendered pages and htmx responses: ```html ``` or set them from JavaScript: ```js document.querySelector("bl-calendar").events = [ { title: "Standup", start: "2026-10-08T09:00" }, ]; ``` The element is registered by `Bloum.init()`, or manually with `Bloum.Calendar.register()`. ## Attributes - `locale`: language of the calendar, e.g. `en` or `fr-CH`. Defaults to the `lang` of the closest ancestor, then `en`. - `week-start`: first day of the week, `0` (Sunday) to `6` (Saturday). Defaults to `1` (Monday). - `date`: month displayed first, `YYYY-MM` or `YYYY-MM-DD`. Defaults to the current month. - `max-events`: rows of events per day, including the "+N more" row. Defaults to `3`. ## Events | Property | Description | | --- | --- | | `title` | Required. | | `start` | Required. `YYYY-MM-DD` for an all-day event, `YYYY-MM-DDTHH:mm` for a timed event, or a `Date`. | | `end` | Optional. For all-day events, the **last day, inclusive**: `2026-10-12` β†’ `2026-10-14` covers three days (iCal and most calendar APIs use an exclusive end date). For timed events, the end date-time. | | `allDay` | Optional. Defaults to `true` when `start` has no time. | | `color` | Optional. Any CSS color, e.g. `#16a34a` or `var(--brand)`. | | `url` | Optional. Renders the event as a link (`http(s):`, `mailto:`, `tel:` or relative URLs). | Date-times without an offset are read in local time; with `Z` or an offset they are shown in the browser's time zone. An event is shown on every day it overlaps; an end at exactly midnight doesn't count the next day. Invalid events are skipped with a warning in the console. ## JavaScript API - `events`: get or set the events (assign a new array to update them) - `month`: first day of the displayed month - `prev()`, `next()`, `today()`: navigate between months - `gotoDate(date)`: show the month of a `Date` or an ISO string The `bl-calendar-navigate` event bubbles after the first render and every time the visible range changes, e.g. to load the events of the new month. `event.detail` holds `month`, `start` (first visible day), `end` (day after the last visible day) and `startStr` / `endStr` as `YYYY-MM-DD`. ## Localization Month and day names come from `Intl`, so they follow any locale. The few labels of the calendar are translated in English and French; register other languages on `Bloum.Calendar.locales` (without one, labels fall back to English): ```js Bloum.Calendar.locales.de = { today: "Heute", previousMonth: "Vorheriger Monat", nextMonth: "NΓ€chster Monat", close: "Schließen", more: (count) => `+${count} weitere`, moreLabel: (count, date) => `${count} weitere Termine anzeigen, ${date}`, }; ``` ## CSS classes - `.calendar-header`, `.calendar-nav`, `.calendar-title`: the header - `.calendar-grid`, `.calendar-weekdays`, `.calendar-week`: the grid - `.calendar-day`, `.calendar-day-today`, `.calendar-day-outside` (other month), `.calendar-day-number` - `.calendar-event`, `.calendar-event-bar` (all-day and multi-day), `.calendar-event-clip-start` / `-clip-end` (continues from / into another week), `.calendar-event-time`, `.calendar-event-title` - `.calendar-more`, `.calendar-popover` ## CSS variables Set on `bl-calendar`: `--bl-calendar-bg`, `--bl-calendar-border-color`, `--bl-calendar-border-radius`, `--bl-calendar-title-fs`, `--bl-calendar-title-fw`, `--bl-calendar-weekday-color`, `--bl-calendar-day-color`, `--bl-calendar-outside-color`, `--bl-calendar-today-bg`, `--bl-calendar-today-color`, `--bl-calendar-hover-bg`, `--bl-calendar-day-header-height`, `--bl-calendar-event-color` (default color of the events), `--bl-calendar-event-height`, `--bl-calendar-event-gap`, `--bl-calendar-popover-shadow`. Give the calendar a height to make its weeks fill it. ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-calendar-bg: var(--bl-clr-surface); --bl-calendar-border-color: var(--bl-border-color); --bl-calendar-border-radius: var(--bl-border-radius-lg); --bl-calendar-title-fs: var(--bl-fs-xl); --bl-calendar-title-fw: var(--bl-fw-medium); --bl-calendar-weekday-color: var(--bl-clr-text-light); --bl-calendar-day-color: var(--bl-clr-text); --bl-calendar-outside-color: var(--bl-clr-text-light); --bl-calendar-today-bg: var(--bl-clr-background-inverted); --bl-calendar-today-color: var(--bl-clr-text-inverted); --bl-calendar-hover-bg: var(--bl-clr-hover-bg); --bl-calendar-day-header-height: 2rem; --bl-calendar-event-color: var(--bl-clr-text-light); --bl-calendar-event-height: 1.375rem; --bl-calendar-event-gap: 0.125rem; --bl-calendar-popover-shadow: var(--bl-shadow-lg); --bl-calendar-event-bg: color-mix( in oklab, var(--bl-calendar-event-color) 16%, var(--bl-calendar-bg) ); --bl-calendar-event-hover-bg: color-mix( in oklab, var(--bl-calendar-event-color) 26%, var(--bl-calendar-bg) ); --bl-calendar-event-fg: color-mix( in oklab, var(--bl-calendar-event-color) 55%, var(--bl-clr-text) ); ``` ## Examples ### Default ```html ``` ### French ```html ``` ### Week Starts On Sunday ```html ``` ### Initial Month ```html ``` ### Fixed Height ```html ``` ### Events From Java Script ```html

``` --- # Card > Container component that groups related content with consistent styling Interactive demo: https://docs.bloum.dev/?path=/docs/components-layout-card--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-card-bg: var(--bl-clr-surface); --bl-card-border-radius: var(--bl-border-radius-lg); --bl-card-border: 1px solid var(--bl-border-color); --bl-card-padding: 1rem; --bl-card-title-fs: var(--bl-fs-lg); --bl-card-title-fw: var(--bl-fw-bold); --bl-card-title-color: var(--bl-clr-text); --bl-card-image-max-height: 150px; --bl-card-footer-bg: var(--bl-clr-surface-muted); --bl-card-description-color: var(--bl-clr-text-light); ``` ## Examples ### Card ```html

List of users

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur corporis deleniti dolores doloribus eius facere.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. At corporis culpa cumque ea ex exercitationem neque nulla perferendis porro rerum totam, veniam voluptates voluptatibus. Dolor dolorum iusto nemo provident quis!
``` ### Card Only Body ```html
Lorem ipsum dolor sit amet, consectetur adipisicing elit. At corporis culpa cumque ea ex exercitationem neque nulla perferendis porro rerum totam, veniam voluptates voluptatibus. Dolor dolorum iusto nemo provident quis!
``` ### Card Only Header ```html

List of users

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur corporis deleniti dolores doloribus eius facere.
``` ### Card With Image ```html
Nature
Featured

List of users

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur, at, commodi ducimus eveniet fugit in, iste mollitia neque nulla obcaecati provident quibusdam repellat sit tempore tenetur ut voluptatem. Provident, quisquam!
``` ### Card With Table ```html

List of users

Name Email Role Actions
Facteur Hyacinthe john.doe@example.com Admin
Albert le Vert john.doe@example.com Admin
Mademoiselle Cassis john.doe@example.com Admin
Total: 1 user
``` --- # Checkbox Card > Card-style checkbox component for selection with enhanced visual presentation Interactive demo: https://docs.bloum.dev/?path=/docs/components-inputs-checkbox-card--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-checkbox-card-checked-border: var(--bl-clr-primary-600); --bl-card-image-max-height: 100px; --bl-card-border: 1px solid var(--bl-checkbox-card-checked-border); ``` ## Examples ### Checkbox Card ```html
``` ### Radio Card ```html
``` ### Simple Checkbox Cards ```html
``` ### Simple Radio Cards ```html
``` --- # Checkbox > Input components for single and multiple selection with customizable styling and states Interactive demo: https://docs.bloum.dev/?path=/docs/components-inputs-checkbox--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-checkbox-checked-bg: var(--bl-clr-primary-600); ``` ## Examples ### Checkbox ```html
``` ### Radio ```html

Select your plan:

``` ### Checkbox Group ```html

Select your interests:

``` ### Inline Checkboxes ```html
``` ### Inline Radios ```html
``` --- # Collapse > Collapsible content component that can be expanded and collapsed Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-collapse--docs ## Examples ### Collapse ```html Toggle collapse

Some content inside the collapse

``` --- # Color Scheme Switcher > Button that opens a dropdown menu with selectable color schemes **Experimental:** the API of this component may change. Interactive demo: https://docs.bloum.dev/?path=/docs/lab-color-scheme-switcher--docs ## Examples ### Color Scheme Switcher ```html ``` --- # Combobox > Input field that suggests and completes text as the user types Interactive demo: https://docs.bloum.dev/?path=/docs/components-inputs-combobox--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-combobox-menu-bg: var(--bl-clr-surface); --bl-combobox-item-bg: var(--bl-clr-control-bg); --bl-combobox-item-active-bg: var(--bl-clr-control-bg-hover); --bl-combobox-placeholder-color: var(--bl-clr-text-subtle); --bl-combobox-option-highlighted-bg: var(--bl-clr-hover-bg); --bl-combobox-option-selected-bg: var(--bl-clr-active-bg); --bl-combobox-option-padding-x: var(--bl-list-item-padding-x); --bl-combobox-option-padding-y: var(--bl-list-item-padding-y); --bl-combobox-option-radius: var(--bl-list-item-radius); --bl-combobox-transition: var(--bl-transition); ``` ## Examples ### Select ```html ``` ### Select Searchable ```html ``` ### Select Multiple ```html ``` ### Select With Data Attributes ```html ``` --- # Command Menu > Searchable command interface activated by keyboard shortcuts **Experimental:** the API of this component may change. Interactive demo: https://docs.bloum.dev/?path=/docs/lab-command-menu--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-cmd-item-bg-hover: var(--bl-clr-hover-bg); --bl-cmd-item-color: var(--bl-clr-text); --bl-cmd-group-color: var(--bl-clr-text-light); ``` ## Examples ### Command Menu ```html ``` --- # Context Menu > Right-click menu that provides contextual actions for specific elements Interactive demo: https://docs.bloum.dev/?path=/docs/components-overlays-context-menu--docs A context menu is the [menu](?path=/docs/components-elements-menu--menu) component opened with a right click and anchored to the pointer instead of a trigger element. ## Usage Give the menu the `menu` and `context-menu` classes, then point the elements it belongs to at it with `data-context-menu`: ```html
Right click me
``` Everything the menu offers works inside a context menu: groups, labels, dividers, shortcuts, submenus, checkboxes and the danger variant. Several elements can share the same menu β€” bind every row of a table to it and the menu opens on the row that was right clicked. When targets are nested, the innermost one wins. Context menus are initialized by `Bloum.init()`, or manually: ```js new Bloum.ContextMenu("#file-menu", ".file-row"); // or bind every `data-context-menu` element of the page Bloum.initContextMenu(); ``` ## Data attributes - `data-context-menu`: CSS selector of the menu to open on right click ## JavaScript API - `open(x, y)`: open the menu at the given viewport coordinates, as reported by the `clientX` and `clientY` of a mouse event - `close()`: close the menu - `isOpen()`: whether the menu is open - `destroy()`: remove all event listeners ## Keyboard The menu behaves like a regular one: ↑ and ↓ move between the items, β†’ and ← enter and leave a submenu, Enter activates the focused item and Escape closes the menu. ## CSS classes - `.context-menu`: added next to `.menu`, grows the menu out of the pointer ## Examples ### Default ```html
Right click anywhere in this area
``` ### With Submenu ```html
Right click to open a menu with submenus
``` ### Shared Between Targets ```html
Name Owner Size
Quarterly report.pdf Ada Lovelace 2.4 MB
Meeting notes.md Alan Turing 12 KB
Logo.svg Grace Hopper 48 KB

Right click any row of the table.

``` ### Nested Targets ```html

Right click the canvas

Sales widget
Right click the card for its own menu.
``` --- # Copy Button > Button that copies text to the clipboard Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-copy-button--docs ## Examples ### Copy Button ```html ``` --- # Data Table > Advanced data table component with enhanced functionality for large datasets **Experimental:** the API of this component may change. Interactive demo: https://docs.bloum.dev/?path=/docs/lab-data-table--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-datatable-controls-gap: 1rem; --bl-datatable-controls-padding: 0.5rem; --bl-datatable-sort-indicator-size: 0.375rem; --bl-datatable-sort-color: var(--bl-clr-text-light); --bl-datatable-sort-active-color: var(--bl-clr-primary-600); --bl-datatable-sortable-hover-bg: var(--bl-clr-hover-bg); --bl-datatable-info-color: var(--bl-clr-text-light); --bl-input-height: 2rem; --bl-input-padding: 0.5rem; --bl-input-fs: var(--bl-fs-base); ``` ## Examples ### Default ```html
ID Name Email Department Salary Start Date
1 Lisa Smith lisa.smith@example.com Sales $53,821 5/9/2023
2 Jane Jones jane.jones@example.com Engineering $110,024 5/25/2022
3 Mike Brown mike.brown@example.com Finance $53,542 3/7/2022
4 Mike Rodriguez mike.rodriguez@example.com Operations $84,843 7/19/2023
5 James Jones james.jones@example.com Marketing $58,710 4/23/2022
6 Robert Martinez robert.martinez@example.com Operations $62,482 3/22/2023
7 James Jones james.jones@example.com Finance $79,321 8/27/2022
8 Emily Martinez emily.martinez@example.com Engineering $86,374 12/2/2021
9 Emily Davis emily.davis@example.com Engineering $46,089 11/20/2022
10 David Johnson david.johnson@example.com Sales $115,854 2/11/2021
11 Sarah Miller sarah.miller@example.com Sales $108,007 10/4/2021
12 Mary Jones mary.jones@example.com Engineering $45,899 4/14/2022
13 Robert Garcia robert.garcia@example.com Sales $114,867 6/19/2022
14 Robert Garcia robert.garcia@example.com Finance $71,683 8/19/2021
15 Mary Martinez mary.martinez@example.com Sales $114,145 7/6/2021
16 Sarah Smith sarah.smith@example.com Finance $93,517 10/27/2022
17 Lisa Brown lisa.brown@example.com Engineering $109,314 7/17/2023
18 Mike Davis mike.davis@example.com Marketing $93,659 12/10/2022
19 Jane Martinez jane.martinez@example.com Marketing $108,473 12/9/2022
20 James Garcia james.garcia@example.com Marketing $114,625 2/18/2021
21 Sarah Williams sarah.williams@example.com Sales $61,674 9/23/2020
22 Emily Williams emily.williams@example.com Marketing $49,802 11/9/2020
23 Jane Jones jane.jones@example.com Engineering $102,948 5/10/2022
24 James Williams james.williams@example.com Operations $68,463 7/12/2022
25 James Davis james.davis@example.com Engineering $101,071 7/22/2021
``` ### Small Dataset ```html
ID Name Email Department Salary Start Date
1 James Rodriguez james.rodriguez@example.com Engineering $81,500 7/15/2023
2 Robert Johnson robert.johnson@example.com Finance $42,385 12/14/2020
3 Robert Garcia robert.garcia@example.com Finance $106,220 12/9/2021
4 Sarah Rodriguez sarah.rodriguez@example.com HR $111,559 10/3/2020
5 Mike Johnson mike.johnson@example.com HR $43,664 6/2/2022
6 Mary Smith mary.smith@example.com Engineering $83,815 6/2/2021
7 John Davis john.davis@example.com Operations $77,157 1/16/2021
8 Mike Johnson mike.johnson@example.com Operations $61,329 11/18/2023
9 Mary Jones mary.jones@example.com Marketing $59,410 4/17/2021
10 David Smith david.smith@example.com Sales $104,053 9/11/2022
``` ### Basic Table Example ```html
Product Category Price Stock Rating
Laptop Pro 15" Electronics $1,299 45 4.5
Wireless Mouse Accessories $29 150 4.2
USB-C Hub Accessories $49 89 4.7
Monitor 27" Electronics $399 23 4.6
Mechanical Keyboard Accessories $89 67 4.8
Webcam HD Electronics $79 112 4.1
Desk Lamp Office $45 78 4.3
Standing Desk Office $599 15 4.7
Office Chair Office $299 34 4.4
Headphones Electronics $199 56 4.6
Smartphone Stand Accessories $19 234 4.0
Cable Organizer Accessories $12 456 3.9
``` ### With Actions ```html
User Role Status Actions
Alice Johnson Admin Active
Bob Smith Editor Active
Charlie Brown Viewer Pending
Diana Prince Editor Inactive
Ethan Hunt Admin Active
Fiona Gallagher Viewer Active
``` ### Api Example ```html

DataTable API Example

Use the buttons below to interact with the DataTable API

ID Item Quantity Price
1Apple50$0.50
2Banana30$0.30
3Orange25$0.60
4Grape100$2.00
5Watermelon5$5.00
6Strawberry40$3.00
7Pineapple10$4.00
8Mango15$1.50
9Peach20$1.00
10Pear35$0.80
11Cherry60$4.00
12Kiwi25$1.20
``` --- # Drawer > Panel that slides in from the side of the screen over existing content Interactive demo: https://docs.bloum.dev/?path=/docs/components-overlays-drawer--docs The Drawer component provides a slide-out panel that appears from the left or right side of the screen, perfect for navigation, settings, or contextual content. ## Features - **Accessible**: Includes proper ARIA attributes and focus management - **Keyboard Navigation**: Supports ESC key to close - **Focus Trap**: Keeps focus within the drawer while open - **Multiple Sizes**: Small, medium, and large width variants - **Position**: Can slide in from right (default) or left side - **Backdrop Click**: Click outside to close - **Dimmed Background**: Background is dimmed but not blurred - **Animation**: Smooth slide-in and slide-out animations ## Usage - Use `data-drawer` attribute on triggers to specify target drawer ID - Use `data-drawer-close` attribute on elements to close the drawer - Add `drawer-left` class to position drawer on the left side - Add size classes (`drawer-sm`, `drawer-md`, `drawer-lg`) to drawer content - Press ESC key to close any open drawer ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-drawer-animation-duration: var(--bl-transition-lg); --bl-drawer-panel-bg: var(--bl-clr-surface); --bl-drawer-footer-bg: var(--bl-clr-surface-muted); --bl-drawer-title-color: var(--bl-clr-text); --bl-drawer-padding: 1rem; --bl-drawer-backdrop-bg: var(--bl-clr-overlay); --bl-drawer-border-radius: var(--bl-border-radius-lg); --bl-drawer-shadow: var(--bl-shadow-xl); --bl-drawer-size-sm: 300px; --bl-drawer-size-md: 400px; --bl-drawer-size-lg: 500px; ``` ## Examples ### Basic Drawer A simple drawer that slides in from the right side with header, body, and footer sections. ```html ``` ### Drawer Sizes Demonstrates different drawer sizes: small (300px), medium (400px), and large (500px). ```html
``` ### Drawer Positions Demonstrates drawers that can slide in from either the right (default) or left side of the screen. ```html
``` ### Drawer With Form A drawer containing a form, demonstrating how to use drawers for data entry and settings. ```html ``` --- # Form Field > Wrapper component that provides consistent styling and layout for form inputs with labels and help text Interactive demo: https://docs.bloum.dev/?path=/docs/components-inputs-form-field--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-field-text-help-color: var(--bl-clr-text-light); --bl-field-danger-color: var(--bl-clr-danger-500); --bl-field-text-danger-color: var(--bl-clr-danger-600); --bl-field-success-color: var(--bl-clr-success-500); --bl-field-text-success-color: var(--bl-clr-success-600); --bl-focus-color: var(--bl-field-danger-color); ``` ## Examples ### Default ```html
``` ### With Help Text ```html

Your username will be visible to other users

``` ### With Error ```html

Password must be at least 8 characters long

``` ### With Success ```html

βœ“ Email is available

``` ### With Adapative Help Text ```html

This is a valid email

This username is already taken

``` ### Textarea Field ```html

Maximum 500 characters

``` ### Select Field ```html

Select your country of residence

``` ### Required Field ```html

This field is required

``` ### Multiple Fields ```html

Please enter a valid email address

Brief description for your profile (max 200 chars)

Subscribe to the newsletter

``` ### Input Group Field ```html

Search by name, category, or description

``` --- # Input > Basic text input field for collecting user data Interactive demo: https://docs.bloum.dev/?path=/docs/components-inputs-input--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-input-file-bg: var(--bl-clr-control-bg); --bl-input-file-bg-hover: var(--bl-clr-control-bg-hover); --bl-input-fs: var(--bl-fs-base); --bl-input-select-icon: url("../../icons/chevron.svg"); --bl-input-icon-padding: 2.25rem; --bl-input-icon-color: var(--bl-clr-text-subtle); --bl-password-toggle-color: var(--bl-clr-text-light); --bl-password-toggle-hover: var(--bl-clr-text); --bl-range-track-height: 0.375rem; --bl-range-track-bg: var(--bl-clr-track-bg); --bl-range-track-border-radius: var(--bl-border-radius-full); --bl-range-thumb-size: 1.25rem; --bl-range-thumb-bg: var(--bl-clr-primary-500); --bl-range-thumb-border: 2px solid var(--bl-clr-background); --bl-range-thumb-border-radius: var(--bl-border-radius-full); --bl-range-thumb-shadow: var(--bl-shadow-sm); --bl-range-thumb-hover-shadow: var(--bl-shadow); ``` ## Examples ### Text Input ```html
``` ### Password Input ```html
``` ### Password With Toggle ```html

Password must be at least 8 characters long.

``` ### Email Input ```html
``` ### File Input ```html
``` ### Select ```html
``` ### Multi Select ```html
``` ### Input Group ```html
``` ### All Input Types ```html
``` --- # Menu > Menu that appears when triggered, showing a list of selectable options Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-menu--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-menu-bg: var(--bl-clr-surface); --bl-menu-item-hover-bg: var(--bl-clr-hover-bg); --bl-menu-item-color: var(--bl-clr-text); --bl-menu-divider-color: var(--bl-border-color); --bl-menu-item-padding-x: var(--bl-list-item-padding-x); --bl-menu-item-padding-y: var(--bl-list-item-padding-y); --bl-menu-item-radius: var(--bl-list-item-radius); --bl-menu-item-danger-color: var(--bl-clr-text-danger); --bl-menu-item-danger-hover-bg: var(--bl-clr-hover-bg-danger); --bl-menu-shortcut-color: var(--bl-clr-text-light); --bl-menu-transition: var(--bl-transition); ``` ## Examples ### Menu ```html ``` ### Menu With Icons ```html ``` ### Menu With Danger ```html ``` ### Menu With Checkbox ```html ``` --- # Modal > Popup dialog that overlays the main content and requires user interaction Interactive demo: https://docs.bloum.dev/?path=/docs/components-overlays-modal--docs The Modal component provides an accessible, focus-trapped dialog overlay for displaying content above the main page. ## Features - **Accessible**: Includes proper ARIA attributes and focus management - **Keyboard Navigation**: Supports ESC key to close - **Focus Trap**: Keeps focus within the modal while open - **Multiple Sizes**: Small, medium, large, extra-large, and full-width variants - **Backdrop Click**: Click outside to close (can be configured) - **Nested Support**: Multiple modals can be opened simultaneously - **Animation**: Smooth fade animation ## Usage - Use `data-modal` attribute on triggers to specify target modal ID - Use `data-modal-close` attribute on elements to close the modal - Modal automatically manages focus and prevents body scroll - Press ESC key to close any open modal ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-modal-animation-opacity: var(--bl-transition); --bl-modal-animation-transform: var(--bl-transition); --bl-modal-dialog-bg: var(--bl-clr-surface); --bl-modal-footer-bg: var(--bl-clr-surface-muted); --bl-modal-title-color: var(--bl-clr-text); --bl-modal-padding: 1.5rem; --bl-modal-margin: 4rem; --bl-modal-backdrop-bg: var(--bl-clr-overlay); --bl-modal-backdrop-filter: blur(4px); --bl-modal-border-radius: var(--bl-border-radius-lg); --bl-modal-size-sm: 300px; --bl-modal-size-md: 500px; --bl-modal-size-lg: 800px; --bl-modal-size-xl: 1200px; --bl-modal-size-full: calc(100% - 1rem); ``` ## Examples ### Basic Modal A simple modal with header, body, and footer sections. Shows a login form as an example. ```html ``` ### Modal Sizes Demonstrates different modal sizes: small, medium (default), large, extra-large, and full-width. ```html
``` ### Confirmation Modal A destructive action confirmation modal with prominent action buttons. ```html ``` ### Modal Without Footer A modal that only contains header and body sections, without a footer. ```html ``` ### Modal With Form A comprehensive form modal showing various form elements and validation states. ```html ``` ### Nested Modals Demonstrates opening multiple modals on top of each other. Each modal maintains its own focus trap. ```html ``` ### Modal With Complex Content A modal showcasing complex content including tabs, tables, and interactive elements. ```html ``` --- # Navbar > Top-mounted navigation menu with primary actions and links Interactive demo: https://docs.bloum.dev/?path=/docs/components-navigation-navbar--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-navbar-bg: var(--bl-clr-surface); --bl-navbar-link-color: var(--bl-clr-text-light); --bl-navbar-link-bg-hover: var(--bl-clr-hover-bg); ``` ## Examples ### Navbar ```html ``` --- # Pagination > Navigation controls for splitting large datasets across multiple pages Interactive demo: https://docs.bloum.dev/?path=/docs/components-navigation-pagination--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-pagination-color: var(--bl-clr-text); --bl-pagination-active-border-color: var(--bl-border-color-strong); --bl-pagination-item-bg-hover: var(--bl-clr-hover-bg); --bl-pagination-height: 2.25rem; ``` ## Examples ### Pagination ```html ``` --- # Phone Input > Phone number field with a country selector, formatted as the user types Interactive demo: https://docs.bloum.dev/?path=/docs/components-inputs-phone-input--docs A phone number field with a country selector inside the same border. The number is formatted as it is typed with the pattern of the selected country, and limited to its length. ## Usage Add the `data-phone-input` attribute to any text input: ```html ``` The input keeps the formatted national number (`79 123 45 67`). Its `name` moves to a hidden input that holds the E.164 value (`+41791234567`), so that is what the form submits. Typing or pasting an international number (`+33…` or `0033…`) selects its country, and a leading trunk prefix (`0` in most of Europe) is dropped. A number with an incomplete length is reported as invalid through the constraint validation API, so the browser blocks the form submission like any other invalid field. ## Data Attributes - `data-phone-input`: Enables the phone input - `data-phone-input-country`: ISO code of the default country (defaults to the region of the browser language) - `data-phone-input-countries`: Comma-separated ISO codes of the countries offered in the menu - `data-phone-input-search-placeholder`: Placeholder of the country search field - `data-phone-input-no-results`: Text shown when no country matches the search - `data-phone-input-invalid-message`: Validation message of an incomplete number ## JavaScript ```js const phone = new Bloum.PhoneInput("#phone", { country: "FR" }); phone.value; // "+33612345678" phone.country = "BE"; // Support another country or format Bloum.PhoneInput.countries.push({ code: "MC", dialCode: "377", format: "## ## ## ##" }); ``` Changing the country from the menu dispatches `bl-phone-input-country-change` on the input, with `{ country, dialCode }` as its detail. Flags are emoji: Windows does not ship flag glyphs and shows the two-letter country code instead. ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-phone-input-gap: 0.375rem; --bl-phone-input-flag-size: var(--bl-fs-xl); --bl-phone-input-dial-code-color: var(--bl-clr-text-light); --bl-phone-input-country-hover-bg: var(--bl-clr-hover-bg); --bl-phone-input-menu-bg: var(--bl-clr-surface); --bl-phone-input-menu-width: 18rem; --bl-phone-input-option-highlighted-bg: var(--bl-clr-hover-bg); --bl-phone-input-option-selected-bg: var(--bl-clr-active-bg); --bl-phone-input-option-dial-code-color: var(--bl-clr-text-light); --bl-phone-input-option-padding-x: var(--bl-list-item-padding-x); --bl-phone-input-option-padding-y: var(--bl-list-item-padding-y); --bl-phone-input-option-radius: var(--bl-list-item-radius); ``` ## Examples ### Default ```html
``` ### With Value ```html
``` ### Restricted Countries ```html

Only Switzerland and its neighbours.

``` ### In Form ```html

Submits the number in E.164 format.

``` ### Disabled ```html
``` --- # Pin Input > Specialized input for one-time passwords with separate fields for each digit Interactive demo: https://docs.bloum.dev/?path=/docs/components-inputs-pin-input--docs The Pin Input component is used for entering PIN codes, one-time passwords, or any other numeric codes that need to be entered digit by digit. ## Usage Simply add the `data-pin-input` attribute to any input element: ```html ``` ## Data Attributes - `data-pin-input`: Enables the pin input functionality - `data-pin-input-size`: Number of input fields (default: 6) ## CSS Classes - `.pin-input`: Container for the pin input fields - `.pin-input-field`: Individual input field - `.pin-input-danger`: Error state - `.pin-input-success`: Success state ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-input-border-color: var(--bl-clr-danger-500); --bl-focus-color: var(--bl-clr-danger-500); ``` ## Examples ### Default ```html
``` ### With Value ```html
``` ### In Form ```html
``` ### With States ```html

Invalid PIN code

PIN code verified

``` --- # Popover > Small overlay that appears near a trigger element with contextual content Interactive demo: https://docs.bloum.dev/?path=/docs/components-overlays-popover--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-popover-bg: var(--bl-clr-surface); --bl-popover-title-bg: var(--bl-clr-surface-muted); ``` ## Examples ### Popover ```html

Set the dimensions for the layer.

``` --- # Progress > Visual indicator showing completion status of tasks or processes Interactive demo: https://docs.bloum.dev/?path=/docs/components-elements-progress--docs ## CSS custom properties Declared on the component selector. Override them on the same selector (or a more specific one) β€” setting them on `:root` has no effect. ```css --bl-progress-height: 1rem; --bl-progress-bg: var(--bl-clr-track-bg); --bl-progress-background-color: var(--bl-clr-background-inverted); --bl-progress-border-radius: var(--bl-border-radius-full); --bl-progress-animation-duration: 1.5s; --bl-progress-label-color: var(--bl-clr-white); ``` ## Examples ### Default ```html
``` ### Sizes ```html

Small

Medium (Default)

Large

``` ### Variants ```html

Default

Primary

Success

Danger

Warning

Info

``` ### Striped ```html

Striped

Striped Animated

``` ### With Labels ```html

Progress with percentage

45%

Progress with custom text

Loading...

Striped with label

90% Complete
``` ### Indeterminate ```html

Indeterminate Progress (Loading State)

Indeterminate with Color

Large Indeterminate

``` ### More Examples ```html
File Upload Progress 78%
78% - 234MB/300MB
System Health Good
Storage Usage Warning
Processing...
``` ## Options Markup for each value of the Storybook controls. ### `size` ```html
``` ### `variant` ```html
``` ### `striped` ```html
``` ### `animated` ```html
``` ### `indeterminate` ```html
``` ### `showLabel` ```html
60%
``` --- # Segmented Control > Group of buttons that represent different states or values Interactive demo: https://docs.bloum.dev/?path=/docs/components-inputs-segmented-control--docs A segmented control is a horizontal set of exclusive options. It is backed by a native `` element: ```html ``` Controls are initialized by `Bloum.init()`, or manually: ```js new Bloum.SegmentedControl("#view", { size: "sm" }); // or initialize every control of the page Bloum.initSegmentedControl(); ``` ## Data attributes - `data-segmented-control`: enables the segmented control - `data-segmented-control-size`: `sm`, `md` (default) or `lg` - `data-segmented-control-block`: full width, with equally sized segments - `data-icon` on an `