UI Library
Layout
Core layout components that structure our applications
AppLayout & AppMain
Full-screen container and main content wrapper
Usage
import { AppLayout, AppMain } from '@/components/ui'
<AppLayout>
<AppSidebar>...</AppSidebar>
<AppMain>
<YourContent />
</AppMain>
</AppLayout>Features
- Full-screen flex container
- 248.AI background color (#FAFAFA)
- Handles overflow and scrolling
- 24px padding on main content
Visual Structure
AppLayout structure
AppHeader
Main application header with title and optional actions
With Actions
Simple Header
Usage
import { AppHeader } from '@/components/layout'
<AppHeader
title="My App"
actions={
<>
<Button variant="outline">Help</Button>
<Button>Upgrade</Button>
</>
}
/>PageTitle
Page-level titles with optional subtitles and actions
With Subtitle and Actions
Dashboard
Overview of your key metrics
Simple Title
Simple Page Title
Usage
import { PageTitle } from '@/components/layout'
<PageTitle
title="Page Title"
subtitle="Description"
actions={<Button>Action</Button>}
/>Navigation
Sidebar and navigation components for app-wide navigation
AppSidebar
Collapsible navigation sidebar with header and user section
Usage
import { AppSidebar } from '@/components/ui'
<AppSidebar
appName="My App"
defaultOpen={true}
onToggle={(isOpen) => setSidebarOpen(isOpen)}
showUser={true}
>
{/* SidebarNavItem components */}
</AppSidebar>Props
appName: string- Required: Application name in headerchildren: ReactNode- Required: Navigation itemsdefaultOpen?: boolean- Optional: Initial open state (default: true)onToggle?: (isOpen: boolean) => void- Optional: Toggle callbackshowUser?: boolean- Optional: Show user section (default: true)userIcon?: string- Optional: User icon path
Features
- Smooth collapse animation (256px → 48px)
- Auto-switching hamburger/close icons
- User avatar section at bottom
- White background with subtle borders
Example
Open (256px)
Collapsed (48px)
SidebarNavItem
Individual navigation button with icon and label
Usage
import { SidebarNavItem } from '@/components/ui'
<SidebarNavItem
id="dashboard"
label="Dashboard"
iconPath="/icons/sparkles-dark.svg"
isActive={activeTab === 'dashboard'}
isCollapsed={!sidebarOpen}
onClick={() => setActiveTab('dashboard')}
/>Props
id: string- Required: Unique identifierlabel: string- Required: Display texticonPath: string- Required: Path to icon SVG (e.g., "/icons/sparkles-dark.svg")isActive?: boolean- Optional: Active state (default: false)isCollapsed?: boolean- Optional: Collapsed state (default: false)onClick?: () => void- Optional: Click handler
Smart Icon Switching
Icons automatically switch between dark and light versions based on the active state:
- Inactive: Uses dark icon (e.g.,
sparkles-dark.svg) on light background - Active: Automatically switches to light icon (e.g.,
sparkles-light.svg) on dark background
Simply provide the dark icon path - the component handles the rest!
Available Icons
From /Branding Assets/Custom Icons/Dark/SVGs/:
sparkles-dark.svg- AI/Magic featuresaddress-book-dark.svg- Contacts/Inboxmagnifying-glass-dark.svg- Searchsliders-dark.svg- Controls/Settingsbars-dark.svg- List/Table viewgrid-dark.svg- Card/Grid viewbolt-dark.svg- Power/Speedgear-dark.svg- Settings
Examples
Active state uses Midnight background
Interactive Sidebar Demo
Legacy sidebar components with groups, items, and user section
Usage
import {
Sidebar,
SidebarItem,
SidebarGroup,
SidebarUser
} from '@/components/layout'
<Sidebar
isOpen={isOpen}
onToggle={() => setIsOpen(!isOpen)}
header={<h1>App Name</h1>}
footer={<SidebarUser name="User" email="user@example.com" />}
>
<SidebarGroup title="Navigation" isCollapsed={!isOpen}>
<SidebarItem
label="Home"
icon="/icons/home.svg"
isActive={active === 'home'}
isCollapsed={!isOpen}
onClick={() => setActive('home')}
badge={5}
/>
</SidebarGroup>
</Sidebar>UI Components
Interactive elements and reusable UI components
Button
Primary and secondary button variants following 248.AI branding
Usage
import { Button } from '@/components/ui'
<Button>Primary Button</Button>
<Button variant="outline">Secondary Button</Button>
<Button size="sm">Small Button</Button>
<Button disabled>Disabled Button</Button>Examples
Dropdown (Select)
Dropdown selection component for choosing from a list of options
Usage
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue
} from '@/components/ui'
<Select onValueChange={setValue}>
<SelectTrigger>
<SelectValue placeholder="Select option" />
</SelectTrigger>
<SelectContent>
<SelectItem value="option1">Option 1</SelectItem>
<SelectItem value="option2">Option 2</SelectItem>
<SelectItem value="option3">Option 3</SelectItem>
</SelectContent>
</Select>Examples
Checkbox
Checkbox component for binary choices and multi-select options
Usage
import { Checkbox } from '@/components/ui'
import { Label } from '@/components/ui'
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<Checkbox
id="terms"
checked={isChecked}
onCheckedChange={setIsChecked}
/>
<Label htmlFor="terms">
Accept terms and conditions
</Label>
</div>Examples
Features
- Uses 248.AI Midnight (#1C1B20) for checked state
- Clean border styling with #EEEEEE
- Supports disabled state
- Accessible with proper label associations
Side Panel
Slide-in panel from the right for additional content or forms
Usage
import { SidePanelPlaceholder } from '@/components/side-panel'
<Button onClick={() => setIsOpen(true)}>
Open Panel
</Button>
<SidePanelPlaceholder
isOpen={isOpen}
onClose={() => setIsOpen(false)}
/>Demo
Design System
Visual foundations and branding guidelines
248.AI Color Palette
Monochromatic grayscale system used throughout components
Midnight
#1C1B20 - Headers, active states
Shadow
#40404C - Body text
Sky
#777D8D - Supporting text
Sheen
#B9B8C0 - Subtle elements
Glare
#EEEEEE - Borders, backgrounds
White
#FFFFFF - Main backgrounds
Resources
Documentation, guides, and real-world examples
Documentation
Complete guides and resources
/Branding Assets/248-BRANDING-GUIDE.md- Complete branding guidelines/Branding Assets/Custom Icons/- 70+ custom icons (dark & light)README.md- Laboratory overview and component status
Live Example
This Laboratory app uses these components!
The layout you're viewing right now is built with:
AppLayout- The full-screen containerAppSidebar- The collapsible left sidebarSidebarNavItem- Each navigation buttonAppMain- This content areaAppTitle- The "UI Library" heading above
View the source at: src/app/page.tsx