@quartix/grid
Configuration

Column Definition

The columns array is the blueprint of your grid. Each object in the array defines how a data field should be rendered and interacted with.

GridColumn API

keyRequired
string

Unique identifier for the column. Maps to data fields.

headerRequired
string

Display label shown in the header.

width
number

Fixed width in pixels.

flex
number | boolean

Allows column to grow and fill available space.

resizable
boolean

Enables manual column resizing by dragging.

sortable
boolean

Allows sorting by clicking the header.

filterable
boolean | ColumnFilter

Configures the column filter type (text, select, etc).

formatter
(v) => string

Simple function to format value for display.

cellRenderer
(v, row) => ReactNode

Advanced custom React component renderer for the cell.

editable
boolean

Enables inline editing for this column.

align
'left' | 'center' | 'right'

Horizontal alignment of cell content.

Custom Rendering

There are two ways to customize cell display. formatter is best for strings (currency, dates).cellRenderer is for complex React components (avatars, buttons, badges).

{
  key: "salary",
  header: "Pay",
  formatter: (v) => `$${v.toLocaleString()}`,
  cellRenderer: (v) => (
    <div className="flex items-center gap-2">
        <div className="w-2 h-2 rounded-full bg-green-500" />
        <span>$${v.toLocaleString()}</span>
    </div>
  )
}