COMPONENTS

90 pre-built components organized by category. All use design tokens and the terminal aesthetic.

[DESIGN RULES]

All FABRK components follow these rules. Apply them when composing components together.

import pattern
import { Button, Card, Badge, BarChart, KPICard } from '@fabrk/components'
import { cn } from '@fabrk/core'
import { mode } from '@fabrk/design-system'
critical design rules
// RULE 1: Full borders — ALWAYS add mode.radius
<Card className={cn("border border-border", mode.radius)}>
<div className={cn("border-2 border-border", mode.radius)}>

// RULE 2: Partial borders — NEVER add mode.radius
<div className="border-t border-border">
<div className="border-b border-border">

// RULE 3: Table cells — NEVER add mode.radius (breaks layout)
<td className="border-b border-border px-4 py-3">

// RULE 4: Switches — Always rounded-full (pill-shaped)
<Switch className="rounded-full">

// RULE 5: Button text — UPPERCASE with > prefix
<Button>> SUBMIT</Button>
<Button>> CONTINUE</Button>

// RULE 6: Labels — UPPERCASE in brackets
<Badge>[ACTIVE]</Badge>
<span>[SYSTEM]</span>

// RULE 7: Use design tokens — NEVER hardcode colors
className="bg-primary text-primary-foreground"  // correct
className="bg-blue-500 text-white"              // WRONG
[DESIGN TOKEN REFERENCE]
Backgrounds: bg-background, bg-card, bg-muted, bg-primary, bg-secondary, bg-destructive
Text: text-foreground, text-muted-foreground, text-primary, text-destructive, text-success
Borders: border-border, border-primary

[KEY COMPONENT EXAMPLES]

Code examples for the most commonly used components. See the full category listing below for all 90 components.

KPICARD

Key performance indicator card with value, label, and trend arrow.

KPICard
import { KPICard } from '@fabrk/components'

<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
  <KPICard title="REVENUE" value="$12,340" trend={12.5} />
  <KPICard title="USERS" value="1,572" trend={8.3} />
  <KPICard title="ERRORS" value="3" trend={-50.0} />
  <KPICard title="UPTIME" value="99.9%" trend={0.1} />
</div>

DATATABLE

Sortable, filterable data table with pagination. Accepts column definitions and row data.

DataTable
import { DataTable } from '@fabrk/components'

const columns = [
  { key: 'name', label: 'NAME', sortable: true },
  { key: 'email', label: 'EMAIL', sortable: true },
  { key: 'role', label: 'ROLE' },
  { key: 'status', label: 'STATUS' },
]

const data = [
  { name: 'Jason', email: 'jason@example.com', role: 'Admin', status: 'Active' },
  { name: 'Sarah', email: 'sarah@example.com', role: 'Member', status: 'Active' },
  { name: 'Mike', email: 'mike@example.com', role: 'Member', status: 'Invited' },
]

<DataTable
  columns={columns}
  data={data}
  onSort={(key, direction) => console.log(key, direction)}
  onRowClick={(row) => router.push(`/users/${row.id}`)}
/>

BARCHART AND LINECHART

Data visualization with theme-aware colors. All 8 chart types share a consistent API.

BarChart + LineChart
import { BarChart, LineChart, Card } from '@fabrk/components'
import { cn } from '@fabrk/core'
import { mode } from '@fabrk/design-system'

const revenueData = [
  { label: 'Jan', value: 4200 },
  { label: 'Feb', value: 5100 },
  { label: 'Mar', value: 4800 },
  { label: 'Apr', value: 6300 },
  { label: 'May', value: 7200 },
]

// Bar chart
<Card className={cn('p-6 border border-border', mode.radius)}>
  <h3 className={cn('text-xs uppercase mb-4', mode.font)}>[MONTHLY REVENUE]</h3>
  <BarChart data={revenueData} />
</Card>

// Line chart
<Card className={cn('p-6 border border-border', mode.radius)}>
  <h3 className={cn('text-xs uppercase mb-4', mode.font)}>[TREND]</h3>
  <LineChart data={revenueData} />
</Card>

DONUTCHART AND GAUGE

DonutChart + Gauge
import { DonutChart, Gauge } from '@fabrk/components'

// Donut chart with center label
<DonutChart
  data={[
    { label: 'Desktop', value: 62 },
    { label: 'Mobile', value: 28 },
    { label: 'Tablet', value: 10 },
  ]}
  centerLabel="TRAFFIC"
/>

// Circular gauge
<Gauge value={73} max={100} label="CPU USAGE" />

CHAT COMPONENTS

Build AI chat interfaces with ChatInput, ChatMessageList, and TokenCounter.

AI Chat Interface
import {
  ChatInput, ChatMessageList, ChatSidebar, TokenCounter, UsageBar
} from '@fabrk/components'

function AIChat({ messages, conversations, onSend, onSelectConversation }) {
  return (
    <div className="flex h-screen">
      {/* Conversation sidebar */}
      <ChatSidebar
        conversations={conversations}
        onSelect={onSelectConversation}
        onNew={() => createConversation()}
      />

      {/* Main chat area */}
      <div className="flex-1 flex flex-col">
        <div className="flex items-center justify-between p-4 border-b border-border">
          <h2 className="text-sm font-bold uppercase">[CHAT]</h2>
          <TokenCounter used={1250} limit={4096} />
        </div>

        <ChatMessageList messages={messages} className="flex-1" />

        <div className="p-4 border-t border-border">
          <UsageBar used={23.50} limit={50} label="DAILY BUDGET" />
          <ChatInput onSend={onSend} placeholder="Ask anything..." />
        </div>
      </div>
    </div>
  )
}

NOTIFICATION CENTER

NotificationCenter
import {
  NotificationCenter, NotificationBadge, NotificationList
} from '@fabrk/components'

// Dropdown notification center
<NotificationCenter
  notifications={notifications}
  onMarkRead={(id) => markAsRead(id)}
  onMarkAllRead={() => markAllRead()}
/>

// Or build your own with parts
<div className="relative">
  <NotificationBadge count={unreadCount} />
  <NotificationList
    notifications={notifications}
    onDismiss={(id) => dismiss(id)}
  />
</div>

MFA COMPONENTS

MFA Setup
import { MfaCard, MfaSetupDialog, BackupCodesModal } from '@fabrk/components'

// MFA status card
<MfaCard
  enabled={user.mfaEnabled}
  onEnable={() => setShowSetup(true)}
  onDisable={() => disableMfa()}
/>

// Setup dialog with QR code
<MfaSetupDialog
  open={showSetup}
  onOpenChange={setShowSetup}
  onSetup={async (secret) => {
    await api.post('/api/mfa/enable', { secret })
  }}
  renderQrCode={(uri) => <QRCode value={uri} />}
/>

// Backup codes modal
<BackupCodesModal
  codes={backupCodes}
  onRegenerate={() => api.post('/api/mfa/regenerate')}
/>

PRICING AND MARKETING

PricingCard + OnboardingChecklist
import { PricingCard, UpgradeCTA, OnboardingChecklist } from '@fabrk/components'

// Pricing cards
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
  <PricingCard
    title="FREE"
    price="$0"
    period="/month"
    features={['5 projects', '1GB storage', 'Community support']}
    onSelect={() => selectPlan('free')}
  />
  <PricingCard
    title="PRO"
    price="$29"
    period="/month"
    features={['Unlimited projects', '100GB storage', 'Priority support', 'API access']}
    highlighted={true}
    onSelect={() => selectPlan('pro')}
  />
  <PricingCard
    title="ENTERPRISE"
    price="Custom"
    features={['Everything in Pro', 'SSO/SAML', 'Dedicated support', 'SLA']}
    onSelect={() => contactSales()}
  />
</div>

// Onboarding checklist
<OnboardingChecklist
  items={[
    { id: 'profile', label: 'Complete your profile', completed: true },
    { id: 'team', label: 'Invite team members', completed: true },
    { id: 'integration', label: 'Connect your first integration', completed: false },
    { id: 'deploy', label: 'Deploy to production', completed: false },
  ]}
  onItemClick={(id) => router.push(`/onboarding/${id}`)}
/>

TERMINAL FEEDBACK

Terminal-style components
import {
  TerminalSpinner, AsciiProgressBar, StatusPulse,
  Typewriter, LogStream
} from '@fabrk/components'

// Terminal loading spinner
<TerminalSpinner label="DEPLOYING..." />

// ASCII progress bar: [████████░░░░░░░░] 52%
<AsciiProgressBar value={52} max={100} />

// Status indicator with pulse animation
<StatusPulse status="healthy" label="API" />
<StatusPulse status="degraded" label="DATABASE" />
<StatusPulse status="down" label="QUEUE" />

// Typewriter text effect
<Typewriter text="Initializing FABRK framework..." speed={50} />

// Real-time log stream
<LogStream
  entries={[
    { timestamp: '12:03:45', level: 'info', message: 'Server started on port 3000' },
    { timestamp: '12:03:46', level: 'info', message: 'Connected to database' },
    { timestamp: '12:03:47', level: 'warn', message: 'Rate limiter using in-memory store' },
  ]}
/>

ERROR BOUNDARY

ErrorBoundary
import { ErrorBoundary } from '@fabrk/components'

// Wrap your app or sections in ErrorBoundary
<ErrorBoundary
  fallback={({ error, reset }) => (
    <div className="p-6 text-center">
      <div className="text-destructive text-sm font-bold uppercase">
        [RUNTIME ERROR]
      </div>
      <p className="text-muted-foreground text-xs mt-2">{error.message}</p>
      <button onClick={reset} className="mt-4 text-primary text-xs">
        > RETRY
      </button>
    </div>
  )}
>
  <App />
</ErrorBoundary>

[PROPS REFERENCE]

Prop definitions for the most commonly used components. For the full API, run pnpm docs:api.

BUTTON

PROPTYPEDEFAULTDESCRIPTION
variant"default" | "destructive" | "outline" | "secondary" | "ghost" | "link""default"Visual style variant
size"default" | "sm" | "lg" | "icon""default"Button size
loadingbooleanfalseShow loading spinner and disable button
loadingTextstringAccessible label shown during loading
asChildbooleanfalseRender as child element (Slot)

CARD

PROPTYPEDEFAULTDESCRIPTION
classNamestringAdditional CSS classes. Always add mode.radius for border radius.
childrenReactNodeCard content. Use CardHeader, CardContent, CardFooter for structure.

KPICARD

PROPTYPEDEFAULTDESCRIPTION
titlestringKPI label (renders UPPERCASE)
valuestring | numberDisplay value
trendnumberPercentage change. Positive = green arrow up, negative = red arrow down.
iconReactNodeOptional icon beside the title

DATATABLE

PROPTYPEDEFAULTDESCRIPTION
columnsColumnDef[]TanStack Table column definitions
dataT[]Row data array
searchKeystringColumn key to enable search filtering
onRowClick(row: T) => voidCallback when a row is clicked
pageSizenumber10Rows per page

BARCHART

PROPTYPEDEFAULTDESCRIPTION
data{ label: string; value: number }[]Chart data points
heightnumber300Chart height in pixels
horizontalbooleanfalseRender as horizontal bar chart
stackedbooleanfalseStack bars (for multi-series data)
colorByIndexbooleanfalseUse different colors per bar

STARRATING

PROPTYPEDEFAULTDESCRIPTION
valuenumberCurrent rating value
maxnumber5Maximum number of stars
onChange(value: number) => voidCallback when a star is clicked
readonlybooleanfalseDisplay-only mode, disables interaction
size"sm" | "md" | "lg""md"Star size

NPSSURVEY

PROPTYPEDEFAULTDESCRIPTION
onSubmit(score: number, feedback?: string) => voidCallback with score (0-10) and optional feedback text
onDismiss() => voidCallback when dismiss button is clicked
titlestring"How likely..."Survey question text

GAUGE

PROPTYPEDEFAULTDESCRIPTION
valuenumberCurrent value
maxnumber100Maximum value
labelstringLabel below the gauge
unitstringUnit suffix (e.g., "%")
segments{ color: string; end: number }[]Color segments for the arc

DIALOG

PROPTYPEDEFAULTDESCRIPTION
openbooleanControlled open state
onOpenChange(open: boolean) => voidCallback when open state changes
childrenReactNodeUse DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription

SELECT

PROPTYPEDEFAULTDESCRIPTION
valuestringControlled selected value
onValueChange(value: string) => voidCallback when selection changes
placeholderstringPlaceholder text when no value is selected
disabledbooleanfalseDisable the select

CHATINPUT

PROPTYPEDEFAULTDESCRIPTION
onSend(message: string, attachments?: File[]) => voidCallback when message is sent (Enter key or button)
onStop() => voidCallback when stop button is clicked during streaming
isLoadingbooleanfalseShow stop button instead of send button
models{ id: string; name: string }[]Available AI models for the model selector
selectedModelIdstringCurrently selected model ID
onModelChange(modelId: string) => voidCallback when model selection changes

MFACARD

PROPTYPEDEFAULTDESCRIPTION
twoFactorEnabledbooleanCurrent 2FA status
onEnable2FA() => voidCallback to start MFA setup
onDisable2FA() => voidCallback to disable MFA
onViewBackupCodes() => voidCallback to view backup codes
isEnabling2FAbooleanLoading state for enable action
isDisabling2FAbooleanLoading state for disable action

COOKIECONSENT

PROPTYPEDEFAULTDESCRIPTION
onAcceptAll(prefs: CookiePreferences) => voidCallback when all cookies are accepted
onAcceptSelected(prefs: CookiePreferences) => voidCallback when selected cookies are accepted
onRejectAll(prefs: CookiePreferences) => voidCallback when all non-essential cookies are rejected
cookieKeystring"cookie-consent"localStorage key for persisting preferences

SEGMENTEDCONTROL

PROPTYPEDEFAULTDESCRIPTION
options{ value: T; label: string; disabled?: boolean }[]Segment options
valueTCurrently selected value
onChange(value: T) => voidCallback when selection changes
size"sm" | "md" | "lg""md"Control size

PROGRESS

PROPTYPEDEFAULTDESCRIPTION
valuenumberProgress value (0-100)
labelstringLabel text above the bar
showPercentagebooleantrueShow percentage text
size"sm" | "md" | "lg""md"Bar height

[ALL CATEGORIES]

[FORM CONTROLS]

Input components for forms and data entry.

Button[DOCS]
Primary action button with terminal styling
Input[DOCS]
Text input with label and error states
InputGroup
Input with prefix/suffix addons
InputNumber
Numeric input with increment/decrement
InputOTP
One-time password input
InputPassword
Password input with show/hide toggle
InputSearch
Search input with icon
Textarea
Multi-line text input
Select[DOCS]
Dropdown select with options
Checkbox[DOCS]
Checkbox input
RadioGroup
Radio button group
Switch[DOCS]
Toggle switch (always rounded-full)
Slider
Range slider input
DatePicker
Calendar-based date selector
Calendar
Calendar component
Form
Form wrapper with validation
FormError
Form error message display
Label
Form input label

[LAYOUT]

Structural layout components.

Card[DOCS]
Content container with border
Container
Max-width content wrapper
Separator
Horizontal or vertical divider
ScrollArea
Scrollable content area
Sidebar
Application sidebar
Tabs / StyledTabs
Tab navigation
Accordion[DOCS]
Collapsible content sections

[DATA DISPLAY]

Components for displaying data and metrics.

DataTable[DOCS]
Sortable, filterable data table
Table
Basic HTML table with styling
KPICard
Key performance indicator card with trend
StatCard
Statistics display card
Badge[DOCS]
Status badge with variants
Tag
Categorization tag
Avatar
User avatar with fallback
Heatmap
Activity heatmap grid
JSONViewer
Formatted JSON display
CodeBlock
Syntax-highlighted code
Pagination
Page navigation
EmptyState[DOCS]
Empty state placeholder
Breadcrumb
Navigation breadcrumbs

[CHARTS]

8 chart types for data visualization. All use design tokens and support theming.

[FEEDBACK]

User interaction and feedback components.

Alert
Inline alert message
AlertDialog
Confirmation dialog
Dialog[DOCS]
Modal dialog
Sheet
Slide-out panel
Toaster
Toast notification system
Loading
Loading spinner
TerminalSpinner
Terminal-style loading animation
Progress[DOCS]
Progress bar
AsciiProgressBar
ASCII-art progress bar
StatusPulse
Pulsing status indicator
Typewriter
Typewriter text effect
StarRating[DOCS]
Star rating input
NPSSurvey
Net Promoter Score survey
FeedbackWidget[DOCS]
Inline feedback collector
ErrorBoundary
React error boundary with terminal UI

[AI]

AI chat and interaction components.

ChatInput
Chat input with attachment support
ChatMessageList
Message list with streaming
ChatSidebar
Conversation list sidebar
TokenCounter
Token usage counter
UsageBar
AI usage progress bar
LogStream
Real-time log streaming display

[ADMIN]

Admin dashboard components.

AuditLog[DOCS]
Audit log table viewer
AdminMetricsCard
Admin metrics display
SystemHealthWidget
System health dashboard
NotificationCenter
Notification center dropdown
NotificationBadge
Unread count badge
NotificationList
Notification list view

[SECURITY]

Security and authentication UI.

MfaCard[DOCS]
MFA status card
MfaSetupDialog
MFA setup wizard
BackupCodesModal
Backup code management
CookieConsent[DOCS]
Cookie consent banner

[ORGANIZATION]

Team and organization management.

OrgSwitcher[DOCS]
Organization selector
MemberCard
Team member display
TeamActivityFeed
Team activity timeline

[MARKETING]

Marketing and onboarding.

PricingCard
Pricing plan card
UpgradeCTA
Upgrade call-to-action
OnboardingChecklist
Onboarding progress checklist
SchemaScript
JSON-LD structured data for SEO
SimpleIcon
Simple icon component