GridConfig
Since v0.0.1
Grid configuration for React applications.
Uses React-augmented ColumnConfig that accepts JSX render functions.
type GridConfig = Omit<BaseGridConfig<TRow, TField>, "columns" | "loadingRenderer" | "emptyRenderer"> & { columns?: ColumnConfig<TRow, TField>[]; loadingRenderer?: BaseGridConfig<TRow>["loadingRenderer"] | (ctx: LoadingContext) => ReactNode; emptyRenderer?: BaseGridConfig<TRow>["emptyRenderer"] | (ctx: EmptyContext) => ReactNode }Example
Section titled “Example”import type { GridConfig } from '@toolbox-web/grid-react';
const config: GridConfig<Employee> = { columns: [ { field: 'name', header: 'Name' }, { field: 'status', renderer: (ctx) => <StatusBadge value={ctx.value} />, }, ],};