XiodUI
HomeDocs
OverviewComponentsStyling & CustomizationChangelog

Components

  • Accordion
  • Agent Steps
  • Alert
  • Alert Dialog
  • Aspect Ratio
  • Autocomplete
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • Button Group
  • Button Split
  • Calendar
  • Card
  • Carousel
  • Checkbox
  • Circular Progress
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy To Clipboard
  • Corner Badge
  • Dashboard Grid
  • Date Picker
  • Dialog
  • Dot Matrix
  • Draggable
    Updated
  • Drawer
  • Empty
  • Field
  • Fieldset
  • File Upload
    Updated
  • Form
  • Frame
  • Gauge
  • Grid
  • Group
  • Input
  • Input Group
  • Input OTP
  • Input Payment
  • Input Phone
    Updated
  • Input Sensitive
  • Kbd
  • Kinetic Click
  • Label
  • List Box
    Updated
  • Loader
  • Marker
  • Menu
  • Menubar
  • Message
  • Meter
  • Morphic Toast
  • Navigation Menu
  • Number Field
  • Option Picker
  • Orb
  • Pagination
  • Popover
  • Preview Card
    Updated
  • Progress
  • Radio
  • Resizable
  • Ruler Picker
  • Scroll Area
  • Scroll Bar
  • Select
  • Separator
  • Sidebar
  • Skeleton
  • Slider
  • Sortable
  • Switch
  • Table
  • Tabs
  • Text
  • Textarea
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Toolbar
  • Tooltip
  • Waveform
  • Wheel Picker

Loading...

Preview Skeleton

Installation Skeleton

Usage Skeleton

API Reference Skeleton

Sponsors

Support the development of XiodUI and help us build the best component library on Earth.

+++
Sponsor on GitHub

Dashboard Grid

Previous: Corner BadgeNext: Date Picker

A grid of tiles the user can rearrange and resize by dragging or with the keyboard.

Preview

Loading Preview...

Installation

bun add xiod-ui

Usage

Imports

1import {2  DashboardGrid,3  DashboardTile,4  DashboardTileControls,5  DashboardTileHandle,6  DashboardTileHeader,7  DashboardTileResizeHandle,8  DashboardTileTitle9} from "xiod-ui/dashboard-grid";

Anatomy

1<DashboardGrid>2  <DashboardTile>3    <DashboardTileHeader>4      <DashboardTileTitle />5    </DashboardTileHeader>6  </DashboardTile>7</DashboardGrid>

API Reference

Detailed documentation of properties and options.

DashboardGrid

Accepts render, plus every native <div> attribute.

PropTypeDefaultDescription
layoutReq
DashboardTileData[]
–

The position and size of every tile. Keep it in state and update it from onLayoutChange.

breakpoints
Corner BadgeDate Picker
Breakpoints
{ lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0, }

The smallest grid width, in pixels, at which each breakpoint applies. Only used when cols is an object.

cols
number|BreakpointCols
12

The number of columns: one number for every width, or an object with a count per breakpoint (lg, md, sm, xs, xxs). Tiles wider than the columns shrink to fit.

compactType
"horizontal"|"vertical"
vertical

Which way tiles move to fill gaps: vertical pulls them up, horizontal pulls them towards the start, and null leaves them where they are dropped.

containerPadding
[number, number]
[12, 12]

The space between the tiles and the edge of the grid, in pixels, as [horizontal, vertical].

isDraggable
boolean
true

Whether tiles can be moved, by pointer or keyboard.

isResizable
boolean
true

Whether tiles can be resized, by pointer or keyboard.

labels
Partial<DashboardGridLabels>
–

Replaces the built-in text for this instance. See LabelsProvider to change it everywhere.

margin
[number, number]
[12, 12]

The space between tiles, in pixels, as [horizontal, vertical].

onLayoutChange
((layout: DashboardTileData[]) => void)
–

Called with the new layout after a tile is moved or resized, and only when something changed.

onTileDragEnd
((id: string, layout: DashboardTileData[]) => void)
–

Called with a tile's id and the final layout when a pointer drag ends, moved or not.

onTileDragStart
((id: string, layout: DashboardTileData[]) => void)
–

Called with a tile's id and the layout when a pointer drag starts.

onTileRemove
((id: string) => void)
–

Called with a tile's id when its remove button is pressed. The remove button only shows when this is set.

onTileResizeEnd
((id: string, layout: DashboardTileData[]) => void)
–

Called with a tile's id and the final layout when a pointer resize ends.

onTileResizeStart
((id: string, layout: DashboardTileData[]) => void)
–

Called with a tile's id and the layout when a pointer resize starts.

preventCollision
boolean
false

Whether a tile can't be dropped on top of another. When false, the tiles it lands on move out of its way. Tiles never land on a static tile.

rowHeight
number
60

The height of one row, in pixels.

showGridLines
boolean
false

Whether to draw the column and row lines behind the tiles.

variant
"canvas"|"default"|"ghost"|"bordered"
default

The visual style of the component.

DashboardTile

Accepts render, plus every native <div> attribute.

PropTypeDefaultDescription
idReq
string
–

The tile's id, matching an i in the grid's layout.

variant
"default"|"flat"|"expressive"
default

The visual style of the component.

DashboardTileControls

Accepts render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
icon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

id
string
–

The id of the tile these controls belong to. With it, and the grid's onTileRemove set, they show a remove button by default.

DashboardTileHandle

Accepts render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
icon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

id
string
–

The id of the tile this handle moves, by dragging or with the arrow keys.

DashboardTileHeader

Accepts render, plus every native attribute of the element it renders.

PropTypeDefaultDescription
icon
ReactNode
–

Replaces this icon. Accepts any node; null renders no icon. Takes precedence over IconProvider.

id
string
–

The id of the tile this header belongs to. With it, the header moves the tile when dragged and shows its remove button.

DashboardTileResizeHandle

Accepts render, plus every native <div> attribute.

DashboardTileTitle

Accepts render, plus every native <span> attribute.