Components Overview

Matrix UI provides a comprehensive set of React components built with accessibility, performance, and developer experience in mind.

Component Philosophy

Every Matrix UI component follows these principles:

  • Accessible by Default - WCAG AA compliant with full keyboard navigation
  • Composable Architecture - Build complex UIs from simple primitives
  • Server Component Ready - Optimized for Next.js App Router
  • Type Safe - Full TypeScript support with strict typing
  • Theme Aware - Automatic adaptation to theme changes
  • Zero Runtime CSS - Tailwind CSS for optimal performance

Component Library

UI Components

Core user interface elements

Button

stable

Interactive button with multiple variants

Badge

stable

Display status or count indicators

Avatar

stable

User profile images with fallback

Separator

stable

Visual divider between content

Layout Components

Structure and organize your interface

Card

stable

Container with header, content, and footer sections

Form Components

Input and data collection elements

Input

stable

Text input field with validation support

Label

stable

Form field labels with accessibility

Textarea

stable

Multi-line text input

Checkbox

stable

Toggle selection state

RadioGroup

stable

Single selection from options

Switch

stable

Toggle between on/off states

Select

stable

Dropdown selection component

Navigation Components

Navigate and organize content

Tabs

stable

Tabbed interface for content sections

Overlay Components

Floating and modal interfaces

Dialog

stable

Modal dialog for focused interactions

DropdownMenu

stable

Contextual menu with actions

Tooltip

stable

Contextual information on hover

Feedback Components

User feedback and loading states

Alert

stable

Important messages and notifications

Progress

stable

Progress indicators for operations

Skeleton

stable

Loading placeholder for content

Spinner

stable

Animated loading indicator

Component Status

stable

Stable

Production-ready components with stable APIs

beta

Beta

Mostly stable but APIs might change slightly

experimental

Experimental

Early development, expect breaking changes

Import Pattern

All components can be imported from the main package:

import { 
  Button, 
  Card, 
  CardHeader, 
  CardTitle, 
  CardContent 
} from '@matrix-ui/components'

Component Anatomy

Matrix UI components follow consistent patterns:

Simple Components

<Button variant="primary" size="lg">
  Click me
</Button>

Compound Components

<Card>
  <CardHeader>
    <CardTitle>Title</CardTitle>
    <CardDescription>Description</CardDescription>
  </CardHeader>
  <CardContent>
    Content goes here
  </CardContent>
  <CardFooter>
    Footer content
  </CardFooter>
</Card>

Controlled Components

const [value, setValue] = useState('')

<Input 
  value={value}
  onChange={(e) => setValue(e.target.value)}
  placeholder="Controlled input"
/>

Styling Components

Components can be styled using multiple approaches:

Using className

<Button className="mt-4 w-full">
  Full width button with margin
</Button>

Using style prop

<Card style={{ maxWidth: '400px' }}>
  Limited width card
</Card>

Using CSS variables

/* Override component-specific tokens */
:root {
  --button-height: 3rem;
  --card-padding: 2rem;
}