DocsGitHub
Getting Started
  • Overview
  • Design Tokens
Components
  • Accordion
  • Alert
  • Announcement
  • Avatar
  • Badge
  • BigCalendar
  • Breadcrumb
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Checkbox
  • Chip
  • CloseButton
  • Combobox
  • CommandPalette
  • ContextMenu
  • Currency
  • DatePicker
  • DescriptionList
  • Drawer
  • DropdownMenu
  • EmptyState
  • Field
  • FileUpload
  • FormGrid
  • Hotkey
  • Icon
  • Input
  • Metric
  • Modal
  • MultiSelect
  • NumberInput
  • Pagination
  • Popover
  • ProgressBar
  • Radio
  • Rating
  • SegmentedControl
  • Select
  • SelectionCard
  • Sidebar
  • Skeleton
  • Slider
  • Spinner
  • Stepper
  • Switch
  • Table
  • Tabs
  • Textarea
  • Timeline
  • TimePicker
  • Toast
  • Tooltip
  • TransferList
  • TreeView
  • Wizard
Charts
  • Overview
  • Area Chart
  • Bar Chart
  • Donut Chart
  • Line Chart
  • Pie Chart
  • Stacked Bar Chart

Sidebar

A collapsible navigation sidebar with header, sections, icons, and nested items.

Installation

tsx
import { Sidebar, SidebarHeader, SidebarSection, SidebarItem } from "madagent";

Default

Main
Dashboard
Users
Documents
Analytics
Settings
Preferences
Notifications

With Header

Acme Inc
Main
Dashboard
Users
Documents
Analytics
Settings
Preferences
Notifications

Nested Items

Store
Overview
Orders
Products

Collapsed

Dashboard
Users
Documents
Settings

Disabled Items

Navigation
Dashboard
Analytics (Coming soon)
Settings

Sidebar Props

PropTypeDefaultDescription
collapsed
boolean
-Controlled collapsed state
onCollapsedChange
(collapsed: boolean) => void
-Called when collapse state changes
width
number
260Sidebar width in pixels
collapsedWidth
number
64Width when collapsed

SidebarHeader Props

PropTypeDefaultDescription
logo
ReactNode
-Logo or icon element
title
string
-Title text (e.g. company name)
children
ReactNode
-Optional extra content

SidebarItem Props

PropTypeDefaultDescription
icon
ReactNode
-Icon element
active
boolean
falseActive/selected state
disabled
boolean
falseDisabled state
href
string
-Link URL (renders as anchor)
items
Array<{ label, href?, active?, disabled? }>
-Nested sub-items

RTL Support

Components automatically adapt to right-to-left languages using CSS logical properties.

Preview

القائمة الرئيسية
لوحة التحكم
المستخدمون
الإعدادات

Usage

tsx
<Sidebar>
  <SidebarSection title="القائمة الرئيسية">
    <SidebarItem icon={<LayoutDashboard size={18} />} active>
      لوحة التحكم
    </SidebarItem>
    <SidebarItem icon={<Users size={18} />}>
      المستخدمون
    </SidebarItem>
    <SidebarItem icon={<Settings size={18} />}>
      الإعدادات
    </SidebarItem>
  </SidebarSection>
</Sidebar>