Skip to main content

Side Bar

The Side Bar adds a collapsible panel alongside the grid with two built-in panels: Columns (toggle column visibility with Select All / Clear All) and Filters (inline text, multi-select, and date filters). Click the tab icons to open or close panels.

Live Demo

Click the tab icons on the right to open Columns or Filters panels
Live
Try it in your framework

The demo above uses Radix UI for styling. To see this feature with your framework's design system (Fluent UI, Material UI, Vuetify, PrimeNG, etc.), click "Open in online demo" below the demo.

import { OGrid } from '@alaarab/ogrid-react-radix';

<OGrid
columns={columns}
data={items}
getRowId={(item) => item.id}
sideBar
columnChooser="sidebar"
pagination
/>
Switching UI libraries

The OGrid component has the same props across all React UI packages. To switch, just change the import:

  • Radix (lightweight, default): from '@alaarab/ogrid-react-radix'
  • Fluent UI (Microsoft 365 / SPFx): from '@alaarab/ogrid-react-fluent' - wrap in <FluentProvider>
  • Material UI (MUI v7): from '@alaarab/ogrid-react-material' - wrap in <ThemeProvider>

Set sideBar to true to enable both panels with default settings. Set columnChooser="sidebar" to move the column chooser from the toolbar into the sidebar's Columns panel.

Panels

Columns Panel

The Columns panel lists every column with a checkbox. Users can:

  • Toggle individual columns on or off
  • Select All to show every column
  • Clear All to hide all non-required columns

Columns with required: true cannot be hidden - their checkboxes are disabled.

Filters Panel

The Filters panel shows inline filter controls for every filterable column:

Column filter typeSidebar control
textText input
multiSelectCheckbox list of options
dateFrom / To date inputs

Filters applied in the sidebar work the same as column header filters - they share state.

Configuration

Pass an ISideBarDef object instead of true to customize panels, position, and default state.

Left Position

Sidebar on the left with Filters panel open by default
Live
import type { ISideBarDef } from '@alaarab/ogrid-react-radix';

const sideBarDef: ISideBarDef = {
position: 'left',
defaultPanel: 'filters',
};

<OGrid
columns={columns}
data={items}
getRowId={(item) => item.id}
sideBar={sideBarDef}
columnChooser="sidebar"
/>

Columns Panel Only

Sidebar with only the Columns panel (no Filters tab)
Live
const sideBarDef: ISideBarDef = {
panels: ['columns'],
defaultPanel: 'columns',
};

<OGrid
columns={columns}
data={items}
getRowId={(item) => item.id}
sideBar={sideBarDef}
columnChooser="sidebar"
/>

Filters Panel Only

const sideBarDef: ISideBarDef = {
panels: ['filters'],
};

<OGrid
columns={columns}
data={items}
getRowId={(item) => item.id}
sideBar={sideBarDef}
/>

Props

ValueBehavior
false / omittedNo side bar
trueBoth panels, right position, collapsed on mount
ISideBarDefFull configuration (see below)

ISideBarDef

FieldTypeDefaultDescription
panelsSideBarPanelId[]['columns', 'filters']Which panels to include.
defaultPanelSideBarPanelId--Panel to open automatically on mount.
position'left' | 'right''right'Which side of the grid the bar appears on.

SideBarPanelId

type SideBarPanelId = 'columns' | 'filters';