Widget Grid

Draggable and resizable widget layout on a CSS grid with keyboard edit affordances.

Also known as: dashboard grid, tile grid, resizable widgets

Installation

Install with the CLI, or copy the component source into your project.

Add widget-grid (npm)

npx --yes -p @default-file/ui df-ui add widget-grid

Default

Drag from the grip, resize from the edges, or tab to the move control and use arrow keys. Shift resizes, Enter commits, Escape cancels, and tiles honor min and max size.

Activity

Twelve updates in the current cycle.

Queue

Five items waiting for review.

Review

Two drafts need a second pass.

Notes

Capture follow-ups for the next session.

Columns

columns sets the grid track count. This board uses six columns instead of twelve.

Activity

Twelve updates in the current cycle.

Queue

Five items waiting for review.

Review

Two drafts need a second pass.

Notes

Capture follow-ups for the next session.

Read only

editable false removes drag, resize, and keyboard edit affordances.

Activity

Twelve updates in the current cycle.

Queue

Five items waiting for review.

Review

Two drafts need a second pass.

Notes

Capture follow-ups for the next session.

Empty

Custom empty content when the layout array is empty.

No widgets on this board.

Row height

minRowHeight overrides the row track size for this instance.

Activity

Twelve updates in the current cycle.

Queue

Five items waiting for review.

Review

Two drafts need a second pass.

Notes

Capture follow-ups for the next session.

Properties

Draggable and resizable widget layout on a CSS grid with keyboard edit affordances.

WidgetGrid

PropTypeDefaultNotes
layoutWidgetLayoutItem[]-Controlled cell placements (required).
onLayoutChange(layout: WidgetLayoutItem[]) => void-Called after a move or resize commits.
renderWidget(id: string) => ReactNode-Render function for each layout id (required).
columnsnumber12Column count for the grid.
editablebooleantrueWhen false, drag, resize, and keyboard edit affordances are disabled.
minRowHeightstring-CSS length override for --df-widget-grid-row-height on this instance.
emptyContentReactNode-Content when the layout array is empty.
aria-labelstring-Accessible name for the grid. Defaults to the kit string catalogue. Override when the host supplies a visible heading.
classNamestring-Additional styles on the root.

WidgetLayoutItem

PropTypeDefaultNotes
idstring-Stable widget id (required).
xnumber-Column index from the left (required).
ynumber-Row index from the top (required).
wnumber-Width in columns (required).
hnumber-Height in rows (required).
minWnumber-Minimum width in columns.
minHnumber-Minimum height in rows.
maxWnumber-Maximum width in columns.
maxHnumber-Maximum height in rows.

Accessibility

Grid name: Pass aria-label when a visible title is not enough; otherwise the catalogue default names the grid. Widget content: renderWidget must supply meaningful content and names inside each cell. Drag handles: Editable cells expose move and resize controls with catalogue labels. Live region: Keyboard edits announce the new cell position and size.