Quick Start
This guide will get you from installation to a working accordion component in under 2 minutes.Installation
Install Monochrome with your preferred package manager:Import the core
Import the Monochrome core once in your app’s entry point (e.g.,main.tsx, App.tsx, or main.ts):
Build your first component
Let’s build a FAQ accordion with collapsible sections.Understanding the API
The accordion is composed of four sub-components:Accordion.Root
The container element with
type prop:type="single"— only one panel can be open at a timetype="multiple"— any combination of panels can be open
Accordion.Item
Each collapsible section. Supports two props:
open— start in the open state (React:open, Vue::open="true")disabled— cannot be toggled, skipped by keyboard navigation
Accordion.Header
Semantic heading wrapper. Use the
as prop to set the heading level (h1 through h6). Defaults to h3.Accordion.Trigger
The button that toggles the panel. Automatically gets proper ARIA attributes (
aria-expanded, aria-controls).Props reference
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Root | type | "single" | "multiple" | "single" | Whether one or many panels can be open |
Item | open | boolean | false | Start open |
Item | disabled | boolean | false | Cannot toggle, skipped by keyboard |
Header | as | "h1" – "h6" | "h3" | Heading level |
Vue note: Boolean props require
: binding in templates: :open="true", :disabled="true"Keyboard navigation
Monochrome includes full keyboard support out of the box:| Key | Action |
|---|---|
ArrowDown / ArrowUp | Navigate between accordion items |
Home / End | Jump to first or last item |
Enter / Space | Toggle the focused item |
Add styling
Monochrome is headless — no CSS is shipped. You have complete control over styling. Here’s a minimal example to get you started:Monochrome uses specific ID prefixes (
mct:accordion:, mcc:accordion:) to identify components. You can target these with CSS attribute selectors.Next steps
Components
Explore Collapsible, Menu, and Tabs components
Accessibility
Learn about keyboard navigation and ARIA attributes
Styling Guide
Advanced styling patterns and examples
API Reference
Complete API documentation for all components