Data Grid
Data Displayatlas-data-gridExamples
Sorting, search and paging
Columns and rows are data. Turn on sorting, the filter row, global search and paging with inputs.
| Ada Lovelace | Engineering | Lead | 128000 |
| Grace Hopper | Engineering | Architect | 135000 |
| Alan Turing | Research | Scientist | 121000 |
| Katherine Johnson | Research | Analyst | 98000 |
| Margaret Hamilton | Engineering | Director | 150000 |
API
Generated from the library source, so it always matches the code.
AtlasDataGridComponent atlas-data-grid
| Input | Type | Default | Description |
|---|---|---|---|
| dataSource required | T[], T[] | null | undefined | — | local mode the grid sorts, filters and pages them; in server mode it shows them as the current page. null / undefined count as no rows. |
| columns required | GridColumn<T>[] | — | field , header , type , width , sortable , filterable , templates, aggregates…), in display order. |
| dataMode | GridDataMode | 'local' | local : the grid does sorting, filtering and paging itself. server : it reports them through stateChange and shows the rows you pass for that state. |
| totalRows | number | 0 | server mode. |
| loading | boolean | false | |
| loadingRowCount | number | 5 | loading . |
| showTotalCount | boolean | false | paginated is off). |
| emptyText | string | '' | emptyText . |
| class | string | '' | cn() ; yours win on conflicts. |
| tableClass | string | '' | <table> . |
| striped | boolean | false | |
| hoverable | boolean | true | |
| dense | boolean | false | |
| bordered | boolean | false | |
| rowHeight | 'compact' | 'default' | 'comfortable' | 'default' | 'compact' — tight rows (~40px) - 'default' — driven by cell padding - 'comfortable' — tall rows (~64px) Overridden per-instance by the --atlas-grid-row-height CSS variable. |
| headerStyle | 'bold' | 'subtle' | 'bold' | 'bold' — current behavior (bold, tracked labels) - 'subtle' — lighter, normal-weight labels |
| height | string | 'auto' | % ). With a fixed height the body scrolls and the header stays visible; auto grows with the rows. |
| maxHeight | string | null | undefined | undefined | height="auto" stops at 70vh , so a long page of rows scrolls inside the grid instead of scrolling the header off screen (not in the card view, which has no header). null lets the grid grow with its rows (the page scrolls). |
| sortable | boolean | undefined | undefined | sortable wins). Defaults to on in local mode, off in server mode. |
| sort | SortState | null | null | |
| filterable | boolean | undefined | undefined | filterable wins). Defaults to on in local mode, off in server mode. |
| showFilterRow | boolean | true | 'filterBar' mode). |
| stateKey | string | null | null | localStorage under this key and restores it when the grid is created. Use one key per grid. null turns it off; getState() / setState() store it elsewhere. |
| filterMode | GridFilterMode | 'filterBar' | 'filterBar' (default) puts a control in the filter row; 'excel' puts a filter button in each header that opens a menu with sort items, a value search and a checkbox list of the column's values. A column's filter.mode overrides it. |
| filterValuesProvider | ((field: string, state: GridServerState) => Promise<GridFilterOption[]>) | null | null | server mode, loads a column's values for its Excel filter (the grid only has the current page). Receives the field and the current server state; columns with filter.options do not call it. Without it, server-mode Excel filters list only filter.options . |
| globalSearch | boolean | undefined | undefined | local mode, off in server mode. |
| searchPlaceholder | string | undefined | undefined | dataGrid.search . |
| paginated | boolean | true | |
| page | number | 1 | pageChange : to control the page, bind [page]="page()" and set your signal from (pageChange) . |
| pageSize | number | DEFAULT_PAGE_SIZE | pageSizeOptions ; the grid resets to the bound value when it changes. |
| pageSizeOptions | SelectOption[] | this.buildPageSizeOptions() | |
| selectionMode | SelectionMode | 'none' | single or multiple adds a selection column and reports it through selectionChange . Set rowId too. |
| rowId | string | ((row: T) => unknown) | null | null | |
| selectedKeys two-way | readonly unknown[] | [] | rowId values) of the selected rows, two-way: [(selectedKeys)] follows the user's selection, and setting it selects those rows ( [] clears it). Needs rowId . A key whose row is not loaded yet (another page in server mode) is applied once that row arrives. |
| rowClassFn | ((row: T, index: number) => string) | null | null | |
| ariaLabel | string | undefined | undefined | dataGrid.ariaLabel . |
| resizable | boolean | true | |
| reorderable | boolean | true | columnReorder . |
| columnSizing | ColumnSizingMode | ColumnSizingConfig | undefined | undefined | width is set. Accepts a bare mode string or a full ColumnSizingConfig object. Defaults to undefined (off): existing grids render exactly as today, so upgrading is a zero-breaking-change, purely additive feature. 'content' is the RECOMMENDED mode — opt in with [columnSizing]="'content'" . - 'content' (recommended): each column is as wide as its widest rendered cell value, with the header label as a minimum. - 'header': columns are sized to fit only their header label. - 'stretch': columns distribute to fill the container width, no horizontal scroll. Columns with an explicit width are never resized. In local mode the full unfiltered local data set ( dataSource ) is measured, so filtering and sorting never change column widths; in server mode only the currently loaded page is measured (widths may shift on page navigation). |
| editType | GridEditType | 'inline' | inline edits the row in place and emits rowSave ; custom only emits addStart / editStart so you can open your own editor (a dialog, a page). |
| allowAdd | boolean | false | |
| allowEdit | boolean | false | |
| allowDelete | boolean | false | deleteRow , and you remove the row from dataSource . |
| confirmDelete | boolean | false | deleteConfirm() dialog) before deleteRow is emitted. |
| confirmDeleteMessage | string | 'Are you sure you want to delete this record? This action cannot be undone.' | |
| actions | GridAction<T>[] | [] | actionClick . |
| actionsColumnPin | 'left' | 'right' | 'none' | 'right' | |
| actionsColumnSticky | boolean | true | |
| locale | Partial<GridLocale> | — | dataGrid ). |
| showToolbar | boolean | true | |
| showColumnChooser | boolean | true | |
| showExportCSV | boolean | false | local mode the grid exports the visible columns of the filtered, sorted rows; in server mode it emits exportRequest . |
| showExportExcel | boolean | false | showExportCSV . |
| detailTemplate | TemplateRef<GridDetailContext<T>> | null | null | $implicit . |
| multiExpand | boolean | true | false closes the previous one. |
| adaptiveView | boolean | true | adaptiveBreakpoint , show each row as a card of label/value pairs instead of the table. false keeps the table at every width (it scrolls horizontally). |
| adaptiveBreakpoint | number | 480 |
| Output | Payload | Description |
|---|---|---|
| sortChange | GridSortEvent | |
| filterChange | GridFilterEvent | |
| pageChange | GridPageEvent | |
| selectionChange | GridSelectionEvent<T> | |
| rowClick | GridRowClickEvent<T> | |
| columnReorder | GridColumnReorderEvent | |
| columnVisibilityChange | { field: string; hidden: boolean } | |
| exportRequest | { format: 'csv' | 'excel' } | server mode, emits when the user asks for an export, so you can produce the file from the server. |
| stateChange | GridServerState | server mode, emits the page, page size, sort, filters and search after any change: load the matching rows. |
| addStart | void | editType="custom" , emits when Add is clicked: open your own editor. |
| editStart | GridEditEvent<T> | inline mode); with editType="custom" open your own editor here. |
| editCancel | GridEditEvent<T> | |
| rowSave | GridRowSaveEvent<T> | dataSource . |
| deleteRow | GridDeleteEvent<T> | confirmDelete ): remove it from dataSource . |
| actionClick | GridActionEvent<T> | actions button is clicked. |
Functions
| Function | Description |
|---|---|
| applyRowDelete<T>(rows: T[], event: GridDeleteEvent<T>, keyField: keyof T): T[] | |
| applyRowSave<T>(rows: T[], event: GridRowSaveEvent<T>, keyField: keyof T): T[] | rowSave event to a local data array. For 'add', prepends the new row. For 'edit', replaces the matching row by key. |
| buildApiParams(state: GridServerState): HttpParams | filter2.<field> , filterOp2.<field> and filterLogic.<field> ( and / or ). |
| compareValues(a: unknown, b: unknown): number | null / undefined last, numbers numerically, Date objects by time, date-shaped strings as dates, other strings with case-insensitive localeCompare . |
| compileColumnFilters<T>(filters: readonly FilterState[], columns: readonly GridEngineColumn[], getValue: GridValueAccessor<T>): GridRowPredicate<T> | null | columns (by field ); a filter on an unknown field compares as text. Returns null when there are no filters, so callers can skip the pass. |
| compileGlobalSearch<T, C extends GridEngineColumn>(term: string, columns: readonly C[], getValue: GridValueAccessor<T>, getFormattedValue: GridFormattedValueAccessor<T, C>): GridRowPredicate<T> | null | filterable: false contains the term, case-insensitively, in its displayed text or in its raw value. The term is trimmed; returns null when it is empty. |
| distinctFilterValues<T, C extends GridEngineColumn>(rows: readonly T[], column: C, getValue: GridValueAccessor<T>, getFormattedValue: GridFormattedValueAccessor<T, C>, blankLabel: string): GridFilterOption[] | value is the cell's key ( filterValueKey : text, ISO for dates), the same key the 'in' operator matches, so ticking options and filtering with their values round-trips. Its label is the displayed text of the first row with that value; empty cells ( null , undefined , '' ) become one option with value '' and blankLabel . Options follow the column's sort order ( compareValues on the raw values), with the blank option last. |
| filterValueKey(raw: unknown): string | 'in' operator and the Excel filter's options): Date objects as ISO strings (stable across browser locales), null / undefined as '' (the blank key), anything else as String(value) . |
| interpolate(template: string, vars: Record<string, string | number>): string | {token} placeholders in a template string (locale texts such as 'Showing {first}–{last} of {total}' ); a missing token becomes '' . |
| matchesFilter(raw: unknown, filter: FilterState, columnType?: string): boolean | second with a non-empty value). columnType picks the comparison: 'number' compares numerically, 'date' compares calendar days, anything else compares lowercase text. A value that cannot be read as a number or a date falls back to a text contains . The 'in' operator (multi-select, Excel filter) matches the value's key ( filterValueKey ) against filter.values , and matches everything when values is empty. |
| sortRows<T>(rows: T[], sort: SortState | null, columns: readonly GridEngineColumn[], getValue: GridValueAccessor<T>): T[] | rows (the input is not mutated). The same array comes back when sort is null or names a field that is not in columns . Values compare with compareValues . |
Types
ColumnSizingConfig
{ mode } .
| Property | Type | Description |
|---|---|---|
| mode | ColumnSizingMode | |
| minWidth? | number | |
| maxWidth? | number | |
| paddingOffset? | number |
ColumnSizingMode
type ColumnSizingMode = 'content' | 'header' | 'stretch'FilterOperator
type FilterOperator = | 'contains' | 'equals' | 'startsWith' | 'endsWith' | 'notEquals' | 'gte' | 'lte' | 'between' | 'in'FilterSecondCondition
FilterState .
| Property | Type | Description |
|---|---|---|
| logic | 'and' | 'or' | |
| operator | FilterOperator | |
| value | string | FilterState.value . |
FilterState
| Property | Type | Description |
|---|---|---|
| field | string | |
| value | string | |
| operator | FilterOperator | |
| values? | string[] | 'in' operator (multi-select filter). When present and non-empty, takes precedence over value . |
| valueTo? | string | 'between' operator (date-range / number range). |
| second? | FilterSecondCondition | logic : 'and' keeps rows that pass both, 'or' rows that pass either. |
GridAction
| Property | Type | Description |
|---|---|---|
| id | string | |
| icon? | string | |
| label? | string | |
| ariaLabel? | string | |
| variant? | ButtonVariants['variant'] | |
| visible? | (row: T) => boolean | |
| disabled? | (row: T) => boolean |
GridActionEvent
| Property | Type | Description |
|---|---|---|
| action | string | |
| row | T | |
| index | number |
GridAggregateConfig
| Property | Type | Description |
|---|---|---|
| type | GridAggregateType | |
| label? | string | |
| format? | (value: number) => string | |
| compute? | (values: number[]) => number |
GridAggregateType
type GridAggregateType = 'sum' | 'avg' | 'count' | 'min' | 'max'GridCellContext
| Property | Type | Description |
|---|---|---|
| $implicit | T | |
| value | unknown | |
| index | number | |
| column | GridColumn<T> |
GridColumn
| Property | Type | Description |
|---|---|---|
| field | keyof T & string | |
| header | string | |
| width? | string | |
| minWidth? | number | |
| maxWidth? | number | |
| align? | 'left' | 'center' | 'right' | |
| sortable? | boolean | sortable ). |
| filterable? | boolean | filterable ). |
| filter? | GridColumnFilterConfig | filterable: false . |
| cellTemplate? | TemplateRef<GridCellContext<T>> | |
| headerTemplate? | TemplateRef<GridHeaderContext<T>> | |
| resizable? | boolean | |
| hidden? | boolean | |
| cellClass? | string | |
| headerClass? | string | |
| textOverflow? | 'ellipsis' | 'wrap' | 'clip' | |
| aggregate? | GridAggregateConfig | |
| pin? | 'left' | 'right' | |
| sizing? | ColumnSizingMode | 'none' | width is set on the column. |
| editable? | boolean | |
| editor? | GridEditor | |
| editorOptions? | SelectOption[] | |
| editorTemplate? | TemplateRef<GridEditorTemplateContext> | |
| required? | boolean | |
| type? | 'text' | 'date' | 'number' | |
| dateFormat? | AtlasDateFormat | |
| numberFormat? | 'decimal' | 'integer' | 'percent' | 'currency' | |
| currency? | string | |
| decimals? | number |
GridColumnFilterConfig
filter?: GridColumnFilterConfig on a GridColumn definition.
| Property | Type | Description |
|---|---|---|
| type? | GridFilterControlType | 'input' (plain text). |
| operator? | FilterOperator | type when omitted (see DEFAULT_FILTER_OPERATOR_BY_TYPE ). |
| placeholder? | string | GridLocale.filterPlaceholder , default Filter ) when omitted. |
| options? | GridFilterOption[] | type: 'select' and type: 'multi-select' . Same shape as the SelectOption of atlas-select and atlas-multi-select . |
| template? | TemplateRef<any> | type: 'custom' . The grid passes a GridFilterCellContext as the implicit template context. |
| mode? | GridFilterMode | filterMode . With 'excel' , type , placeholder and template are ignored and options , when set, is the value list. |
GridColumnReorderEvent
| Property | Type | Description |
|---|---|---|
| columns | string[] | |
| movedField | string | |
| newIndex | number |
GridDataMode
type GridDataMode = 'local' | 'server'GridDeleteEvent
| Property | Type | Description |
|---|---|---|
| row | T | |
| index | number |
GridEditEvent
| Property | Type | Description |
|---|---|---|
| mode | GridEditMode | |
| row | T | null | |
| index | number |
GridEditMode
type GridEditMode = 'add' | 'edit'GridEditor
'json' edits an object or array value in atlas-json-editor ; the row cannot be saved while the text is not valid JSON.
type GridEditor = 'text' | 'number' | 'select' | 'date' | 'json'GridEditorTemplateContext
| Property | Type | Description |
|---|---|---|
| $implicit | unknown | |
| field | string | |
| onInput | (value: unknown) => void |
GridEditType
type GridEditType = 'inline' | 'custom'GridEngineColumn
GridColumn fits it, and so will the column type of any other grid built on this engine.
| Property | Type | Description |
|---|---|---|
| field | string | |
| type? | string | 'number' and 'date' change how filters match and how values compare; anything else is text. |
| filterable? | boolean | false leaves the column out of the global search. |
GridFilterCellContext
| Property | Type | Description |
|---|---|---|
| $implicit | unknown | |
| column | GridColumn<T> | |
| applyFilter | (value: unknown) => void | |
| clearFilter | () => void |
GridFilterControlType
'input' (plain text) when not specified.
type GridFilterControlType = | 'input' // plain text input (default — existing behaviour) | 'select' // atlas-select — single value from a fixed list | 'multi-select' // atlas-multi-select — multiple values → 'in' operator | 'datepicker' // atlas-datepicker — ISO date string | 'date-range' // atlas-date-range-picker — { start, end } → 'between' | 'number' // atlas-number-input — numeric value | 'switch' // atlas-switch — boolean true/false | 'custom'GridFilterEvent
| Property | Type | Description |
|---|---|---|
| filters | FilterState[] |
GridFilterMode
'filterBar' puts a control in the filter row under the header; 'excel' puts a filter button in the header that opens a menu with sort items, a search box and a checkbox list of the column's values.
type GridFilterMode = 'filterBar' | 'excel'GridFilterOption
select / multi-select filter. Same shape as the forms SelectOption , declared here so the engine entry does not depend on the form controls.
| Property | Type | Description |
|---|---|---|
| value | string | FilterState.value , or one of values for 'in' ). |
| label | string | |
| disabled? | boolean |
GridFormattedValueAccessor
type GridFormattedValueAccessor = (row: T, column: C) => stringGridHeaderContext
| Property | Type | Description |
|---|---|---|
| $implicit | GridColumn<T> | |
| sort | SortState | null |
GridLocale
| Property | Type | Description |
|---|---|---|
| search | string | |
| add | string | |
| exportCsv | string | |
| exportExcel | string | |
| columns | string | |
| reset | string | |
| close | string | |
| actionsHeader | string | |
| edit | string | |
| delete | string | |
| save | string | |
| cancel | string | |
| expandRow | string | |
| collapseRow | string | |
| selected | string | |
| emptyText | string | |
| pagerFormat | string | |
| pagerSelectedFormat | string | |
| rowsPerPage | string | |
| totalCountFormat | string | |
| filterContains | string | |
| filterEquals | string | |
| filterStartsWith | string | |
| filterEndsWith | string | |
| filterActiveSingular | string | |
| filterActivePluralFormat | string | |
| noFiltersActive | string | |
| clearFilters | string | |
| filterPlaceholder | string | |
| filterByColumnFormat | string | {column} is the column header. |
| clearColumnFilterFormat | string | {column} is the column header. |
| selectAllRows | string | |
| selectRowFormat | string | {index} is the 1-based row number on the page. |
| ariaLabel | string | ariaLabel . |
| loadingAnnouncement | string | loading is true. |
| saveBlockedAnnouncement | string | |
| loadedAnnouncementFormat | string | {count} is the number of rows. |
| filterButtonFormat | string | {column} is the column header. |
| filterButtonActiveFormat | string | {column} is the column header. |
| filterSortAscending | string | |
| filterSortDescending | string | |
| filterClear | string | |
| filterSearchValues | string | |
| filterSelectAll | string | |
| filterValuesLabel | string | |
| filterBlanks | string | |
| filterNoValues | string | |
| filterLoading | string | |
| filterValuesCountFormat | string | {count} is the number of matching values. |
| filterTooManyValuesFormat | string | {count} is the number of values shown. |
| filterOk | string | |
| filterModeValues | string | |
| filterModeCondition | string | |
| filterModeLabel | string | |
| filterOperatorLabel | string | |
| filterValueLabel | string | |
| filterSecondOperatorLabel | string | |
| filterSecondValueLabel | string | |
| filterLogicLabel | string | |
| filterAnd | string | |
| filterOr | string | |
| filterNotEquals | string | |
| filterGreaterOrEqual | string | |
| filterLessOrEqual | string | |
| sortBy | string | |
| sortAscending | string | |
| sortDescending | string | |
| pagerCompactFormat | string | {first} , {last} and {total} as in pagerFormat . |
GridPageEvent
| Property | Type | Description |
|---|---|---|
| page | number | |
| pageSize | number |
GridRowClickEvent
| Property | Type | Description |
|---|---|---|
| row | T | |
| index | number | |
| event | MouseEvent |
GridRowPredicate
type GridRowPredicate = (row: T) => booleanGridRowSaveEvent
| Property | Type | Description |
|---|---|---|
| mode | GridEditMode | |
| row | T | |
| original | T | null | |
| index | number |
GridSelectionEvent
| Property | Type | Description |
|---|---|---|
| selected | T[] |
GridServerState
stateChange in server mode. Contains everything needed to build an API request.
| Property | Type | Description |
|---|---|---|
| page | number | |
| pageSize | number | |
| sort | SortState[] | |
| filters | FilterState[] | |
| globalSearch | string |
GridSortEvent
| Property | Type | Description |
|---|---|---|
| sort | SortState | null |
GridValueAccessor
field from a row.
type GridValueAccessor = (row: T, field: string) => unknownGridViewState
getState() returns it and setState() / stateKey restore it. Plain JSON, so it can be stored as is.
| Property | Type | Description |
|---|---|---|
| sort | SortState | null | |
| filters | FilterState[] | |
| globalSearch | string | |
| page | number | |
| pageSize | number | |
| columnWidths | Record<string, string> | '160px' ), from resizing or auto-fit. |
| columnOrder | string[] | null | null keeps the columns order. |
| hiddenColumns | string[] |
PaginationState
| Property | Type | Description |
|---|---|---|
| page | number | |
| pageSize | number |
SelectionMode
type SelectionMode = 'none' | 'single' | 'multiple'SortDirection
type SortDirection = 'asc' | 'desc'SortState
| Property | Type | Description |
|---|---|---|
| field | string | |
| direction | SortDirection |