Laboratory

User

User

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

Sidebar
Main Content (AppMain)

AppLayout structure

AppHeader

Main application header with title and optional actions

With Actions

Application Name

Simple Header

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 header
  • children: ReactNode - Required: Navigation items
  • defaultOpen?: boolean - Optional: Initial open state (default: true)
  • onToggle?: (isOpen: boolean) => void - Optional: Toggle callback
  • showUser?: 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)

Laboratory
Dashboard
Search
Settings

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 identifier
  • label: string - Required: Display text
  • iconPath: 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 features
  • address-book-dark.svg - Contacts/Inbox
  • magnifying-glass-dark.svg - Search
  • sliders-dark.svg - Controls/Settings
  • bars-dark.svg - List/Table view
  • grid-dark.svg - Card/Grid view
  • bolt-dark.svg - Power/Speed
  • gear-dark.svg - Settings

Examples

Dashboard (Active)
Search
Settings

Active state uses Midnight background

Interactive Sidebar Demo

Legacy sidebar components with groups, items, and user section

Selected: home

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 container
  • AppSidebar - The collapsible left sidebar
  • SidebarNavItem - Each navigation button
  • AppMain - This content area
  • AppTitle - The "UI Library" heading above

View the source at: src/app/page.tsx