@ithouse-bd/ngx-table 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iTHouse
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,305 @@
1
- # Temporary Holding Version
1
+ # @ithouse-bd/ngx-table
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm version](https://img.shields.io/npm/v/@ithouse-bd/ngx-table.svg)](https://www.npmjs.com/package/@ithouse-bd/ngx-table)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@ithouse-bd/ngx-table.svg)](https://www.npmjs.com/package/@ithouse-bd/ngx-table)
5
+ [![license](https://img.shields.io/npm/l/@ithouse-bd/ngx-table.svg)](https://github.com/ithouse-bd/angular-libs/blob/main/libs/ngx-table/LICENSE)
6
+ [![Angular](https://img.shields.io/badge/Angular-20%2B-dd0031.svg)](https://angular.dev)
7
+
8
+ A generic, fully themeable data table for Angular. Bring your own row type and column
9
+ configuration — the table handles sorting, global search, per-column filters, pagination,
10
+ row selection, row actions and custom templates, for both client-side arrays and
11
+ API-driven (server) data.
12
+
13
+ ![Data table overview](https://raw.githubusercontent.com/ithouse-bd/angular-libs/main/libs/ngx-table/docs/images/table-overview.svg)
14
+
15
+ ```html
16
+ <ith-table title="Students" [data]="students" [columns]="columns" selectionMode="multi">
17
+ </ith-table>
18
+ ```
19
+
20
+ ## Features
21
+
22
+ - **Generic** — `TableColumn<T>` typed against your own row interface; dot-paths for nested data
23
+ - **Sorting** — click a header to cycle `asc → desc → unsorted`, custom comparators per column
24
+ - **Search** — global search box plus a filter row that covers **every column**: text,
25
+ number, date or select controls, per-column placeholders, custom `filterPredicate`, or
26
+ your own filter template
27
+ - **Pagination** — page window, first/last/prev/next, rows-per-page selector and range summary
28
+ - **Selection** — single or multi, select-all for the page or all filtered rows, keep keys across pages
29
+ - **Row actions** — declarative action buttons with icons, classes, disabled/hidden rules, or your own template
30
+ - **Custom templates** — cell, header, row actions, toolbar, footer and empty state
31
+ - **Server mode** — the table emits sort/search/filter/page changes; you supply one page of rows
32
+ - **Copy** — hover a cell (or press Ctrl/Cmd+C on a focused cell) or copy a whole row
33
+ - **Context menu** — right-click / `Shift+F10` emits `rowContextMenu` and renders your
34
+ `ithTableRowMenu` template in a floating panel at the pointer
35
+ - **Column visibility + preset** — toolbar picker; hidden columns and density are saved in
36
+ `localStorage` through `storageKey`
37
+ - **Sticky columns** — stick the checkbox and actions columns (or any column with `sticky`)
38
+ - **Cell tooltips** — full value on hover for truncated cells, opt out per column
39
+ - **Skeleton loading** — placeholder rows instead of a blank table, plus a toolbar
40
+ comfortable/compact density toggle
41
+ - **Presentation** — striped, bordered, dense, hover, sticky header, fixed max height, loading overlay
42
+ - **Theming** — CSS variables with light, dark and system (`auto`) modes; zero style-framework dependency
43
+ - **Signals everywhere** — `input()`, `model()`, `output()`, standalone component, zoneless-safe
44
+ - **No runtime dependencies** except `tslib`
45
+
46
+ ## Compatibility
47
+
48
+ | | Supported |
49
+ | --- | --- |
50
+ | Angular 20 and newer | ✅ |
51
+ | Angular 17, 18, 19 | ❌ not supported (`>=20.0.0` peer range) |
52
+ | Standalone components | ✅ required |
53
+ | `NgModule` wrappers | ❌ removed (import the standalone components directly) |
54
+ | Zoneless change detection | ✅ (signals throughout) |
55
+ | SSR / prerendering | ✅ no direct DOM access |
56
+
57
+ ## Installation
58
+
59
+ ```bash
60
+ npm install @ithouse-bd/ngx-table
61
+ # or
62
+ yarn add @ithouse-bd/ngx-table
63
+ # or
64
+ pnpm add @ithouse-bd/ngx-table
65
+ ```
66
+
67
+ **Angular 20 or newer is required.** `@angular/common` and `@angular/core` are peer
68
+ dependencies.
69
+
70
+ ## Quick start
71
+
72
+ ### 1. Describe your rows
73
+
74
+ ```typescript
75
+ import { TableColumn } from '@ithouse-bd/ngx-table';
76
+
77
+ interface Student {
78
+ id: number;
79
+ name: string;
80
+ email: string;
81
+ roll: number;
82
+ active: boolean;
83
+ }
84
+
85
+ readonly columns: TableColumn<Student>[] = [
86
+ { key: 'roll', header: 'Roll', width: '80px', align: 'center' },
87
+ { key: 'name', header: 'Name', minWidth: '180px' },
88
+ { key: 'email', header: 'Email' },
89
+ {
90
+ key: 'active',
91
+ header: 'Status',
92
+ formatter: (value) => (value ? 'Active' : 'Inactive'),
93
+ },
94
+ ];
95
+ ```
96
+
97
+ ### 2. Render the table
98
+
99
+ ```typescript
100
+ import { Component } from '@angular/core';
101
+ import { TableComponent } from '@ithouse-bd/ngx-table';
102
+
103
+ @Component({
104
+ selector: 'app-students',
105
+ imports: [TableComponent],
106
+ template: `
107
+ <ith-table
108
+ title="Student List"
109
+ [data]="students"
110
+ [columns]="columns"
111
+ selectionMode="multi"
112
+ [pageSize]="10"
113
+ (rowClick)="openStudent($event.row)">
114
+ </ith-table>
115
+ `,
116
+ })
117
+ export class StudentsComponent {}
118
+ ```
119
+
120
+ The `keyField` defaults to `'id'`; set `[keyField]="'studentId'"` when your rows use another
121
+ unique field.
122
+
123
+ ## Custom cell templates
124
+
125
+ Add `ithTableCell` templates for any column key. The context exposes `$implicit` (the row),
126
+ `row`, `column`, `value` and `index`:
127
+
128
+ ```html
129
+ <ith-table [data]="students" [columns]="columns">
130
+ <ng-template ithTableCell="name" let-row let-index="index">
131
+ <strong>{{ index + 1 }}. {{ row.name }}</strong>
132
+ </ng-template>
133
+
134
+ <ng-template ithTableCell="active" let-value="value">
135
+ <span [class.text-success]="value" [class.text-muted]="!value">
136
+ {{ value ? 'Active' : 'Inactive' }}
137
+ </span>
138
+ </ng-template>
139
+ </ith-table>
140
+ ```
141
+
142
+ Import the directive next to the table:
143
+
144
+ ```typescript
145
+ import { TableCellDirective, TableComponent } from '@ithouse-bd/ngx-table';
146
+
147
+ @Component({ imports: [TableComponent, TableCellDirective], /* … */ })
148
+ ```
149
+
150
+ Other slots: `ithTableHeader="key"`, `ithTableFilter="key"`, `ithTableRowActions`,
151
+ `ithTableToolbar`, `ithTableFooter`, `ithTableEmpty`, `ithTableRowMenu`.
152
+
153
+ ## Copy, context menu & column preset
154
+
155
+ ```html
156
+ <ith-table
157
+ [data]="students"
158
+ [columns]="columns"
159
+ [copyable]="true"
160
+ [showColumnPicker]="true"
161
+ [showDensityToggle]="true"
162
+ storageKey="students-table"
163
+ [stickySelection]="true"
164
+ [stickyActions]="true"
165
+ (cellCopy)="onCopy($event)">
166
+
167
+ <ng-template ithTableRowMenu let-row>
168
+ <button type="button" (click)="open(row)">Open</button>
169
+ <button type="button" (click)="remove(row)">Delete</button>
170
+ </ng-template>
171
+ </ith-table>
172
+ ```
173
+
174
+ - `copyable` adds a hover copy button per cell and lets Ctrl/Cmd+C copy the focused cell;
175
+ `(cellCopy)` reports `{ value, row, index, column }`.
176
+ - Right-clicking a row (or `Shift+F10` / the context-menu key) emits `rowContextMenu` with the
177
+ pointer position and renders the `ithTableRowMenu` template in a fixed panel that closes on
178
+ outside click or `Escape`.
179
+ - `showColumnPicker` renders a "Columns" popover; the choice and the density toggle are
180
+ persisted under `storageKey`, so a returning user gets the same layout.
181
+ - `stickySelection` / `stickyActions` keep the first and last columns visible while scrolling
182
+ horizontally; `TableColumn.sticky` does the same for any other column (give it a `width`).
183
+ - `TableColumn.tooltip` (default `true`) puts the full text in the native `title`, which is
184
+ what makes truncated cells readable on hover.
185
+
186
+ ![Selection and row actions](https://raw.githubusercontent.com/ithouse-bd/angular-libs/main/libs/ngx-table/docs/images/table-selection.svg)
187
+
188
+ ## Row actions
189
+
190
+ ```typescript
191
+ readonly actions: TableRowAction<Student>[] = [
192
+ { id: 'edit', label: 'Edit', icon: '✎' },
193
+ {
194
+ id: 'delete',
195
+ label: 'Delete',
196
+ class: 'is-danger',
197
+ disabled: (row) => row.active,
198
+ },
199
+ ];
200
+ ```
201
+
202
+ ```html
203
+ <ith-table
204
+ [data]="students"
205
+ [columns]="columns"
206
+ [rowActions]="actions"
207
+ (actionClick)="handleAction($event)">
208
+ </ith-table>
209
+ ```
210
+
211
+ `$event` is `{ action, row, index }`. Use `#ithTableRowActions` for a completely custom
212
+ actions column.
213
+
214
+ ## Server-side mode
215
+
216
+ ```html
217
+ <ith-table
218
+ mode="server"
219
+ [data]="pageRows()"
220
+ [total]="total()"
221
+ [loading]="loading()"
222
+ [columns]="columns"
223
+ [page]="page()"
224
+ [pageSize]="pageSize()"
225
+ [sort]="sort()"
226
+ [search]="search()"
227
+ (pageChange)="onPage($event)"
228
+ (pageSizeChange)="onPageSize($event)"
229
+ (sortChange)="onSort($event)"
230
+ (searchChange)="onSearch($event)"
231
+ (filterChange)="onFilters($event)">
232
+ </ith-table>
233
+ ```
234
+
235
+ In server mode the table does **not** re-sort, search or slice the array — it renders
236
+ exactly the rows you pass, asks for the rest through outputs, and uses `[total]` for the
237
+ pager. See the [full documentation](https://github.com/ithouse-bd/angular-libs/blob/main/libs/ngx-table/DOCUMENTATION.md)
238
+ for a complete example.
239
+
240
+ ## Theming
241
+
242
+ One token adopts your application's brand colour — header, hover, selected rows, filters,
243
+ footer, focus ring and toolbar buttons all derive from it (light and dark):
244
+
245
+ ```css
246
+ :root {
247
+ --ith-table-brand: #0f766e;
248
+ }
249
+ ```
250
+
251
+ Individual tokens are still available for finer control:
252
+
253
+ ```css
254
+ .my-table {
255
+ --ith-table-brand: #2563eb;
256
+ --ith-table-header-text: #e2e8f0;
257
+ --ith-table-radius: 8px;
258
+ }
259
+ ```
260
+
261
+ Light/dark/auto follows the same convention as `@ithouse-bd/ngx-dropdown`: set
262
+ `data-theme="light" | "dark" | "auto"` on `<html>` or `<body>`. All variables are listed
263
+ in the [theming guide](https://github.com/ithouse-bd/angular-libs/blob/main/libs/ngx-table/THEMING.md).
264
+
265
+ The component ships ~15 kB of scoped CSS (~3 kB gzipped). If your `angular.json` keeps the
266
+ Angular default `anyComponentStyle` budget (8 kB error), raise it to `16kb`/`20kb`.
267
+
268
+ ## API at a glance
269
+
270
+ | Input | Type | Default | Description |
271
+ | --- | --- | --- | --- |
272
+ | `data` | `T[]` | `[]` | Rows to render (current page in server mode) |
273
+ | `columns` | `TableColumn<T>[]` | `[]` | Column configuration |
274
+ | `keyField` | `string` | `'id'` | Unique key path used for selection and tracking |
275
+ | `mode` | `'client' \| 'server'` | `'client'` | Local or API-driven data |
276
+ | `total` | `number` | `0` | Total row count (server mode) |
277
+ | `selectionMode` | `'none' \| 'single' \| 'multi'` | `'none'` | Row selection |
278
+ | `selectAllScope` | `'page' \| 'all'` | `'page'` | What the header checkbox selects |
279
+ | `selected` | `T[]` | `[]` | Two-way bindable selection |
280
+ | `rowActions` | `TableRowAction<T>[]` | `[]` | Action buttons per row |
281
+ | `page` / `pageSize` | `number` | `1` / `10` | Two-way bindable pager state |
282
+ | `search` | `string` | `''` | Two-way bindable global search |
283
+ | `sort` | `TableSort \| null` | `null` | Two-way bindable sort state |
284
+ | `pageSizeOptions` | `number[]` | `[10, 20, 50, 100]` | Rows-per-page choices |
285
+ | `showFilters` | `boolean` | `false` | Per-column filter row (text / number / date / select) |
286
+ | `loading` | `boolean` | `false` | Loading overlay |
287
+ | `striped` / `bordered` / `dense` / `hoverable` | `boolean` | `false` / `false` / `false` / `true` | Presentation modifiers |
288
+ | `stickyHeader` / `maxHeight` | `boolean` / `string` | `false` / `''` | Scroll container behaviour |
289
+
290
+ Outputs: `sortChange`, `searchChange`, `filterChange`, `pageChange`, `pageSizeChange`,
291
+ `selectedChange`, `actionClick`, `rowClick`.
292
+
293
+ Full reference, every template context and recipes:
294
+ **[DOCUMENTATION.md](https://github.com/ithouse-bd/angular-libs/blob/main/libs/ngx-table/DOCUMENTATION.md)**.
295
+
296
+ ## Development
297
+
298
+ ```bash
299
+ npx nx build ngx-table # build the package into dist/libs/ngx-table
300
+ npx nx serve demo-app # run the demo (client + server table examples)
301
+ ```
302
+
303
+ ## License
304
+
305
+ MIT © iTHouse
package/THEMING.md ADDED
@@ -0,0 +1,270 @@
1
+ # Theming `<ith-table>`
2
+
3
+ The table is styled with scoped CSS and a single set of custom properties. Override the
4
+ properties on the component or on any ancestor to restyle everything — no selectors, no
5
+ `!important`, no CSS framework required.
6
+
7
+ ## Contents
8
+
9
+ - [Theme modes](#theme-modes)
10
+ - [Quick start](#quick-start)
11
+ - [Variable reference](#variable-reference)
12
+ - [Ready-made themes](#ready-made-themes)
13
+ - [Presentation modifiers](#presentation-modifiers)
14
+ - [Scoping a theme](#scoping-a-theme)
15
+ - [Accessibility](#accessibility)
16
+
17
+ ## Theme modes
18
+
19
+ The component follows the same convention as `@ithouse-bd/ngx-dropdown`:
20
+
21
+ | Attribute | Result |
22
+ | --- | --- |
23
+ | `data-theme="light"` (default) | Light palette |
24
+ | `data-theme="dark"` or `class="dark"` | Dark palette |
25
+ | `data-theme="auto"` | Follows `prefers-color-scheme` |
26
+
27
+ Set the attribute on `<html>` or `<body>` so the component can pick it up with
28
+ `:host-context()`:
29
+
30
+ ```html
31
+ <html data-theme="dark">
32
+ <body>
33
+ <ith-table [data]="rows" [columns]="columns"></ith-table>
34
+ </body>
35
+ </html>
36
+ ```
37
+
38
+ ![Dark theme](docs/images/table-dark.svg)
39
+
40
+ Switching themes at runtime is a single attribute change:
41
+
42
+ ```typescript
43
+ document.documentElement.setAttribute('data-theme', 'dark');
44
+ ```
45
+
46
+ ## One token = your app's brand
47
+
48
+ Set a single brand colour and every accent surface (header, hover, selected rows, filters,
49
+ footer, focus ring, copy/column buttons) is derived from it with `color-mix()`. This is the
50
+ recommended way to adapt the table to an existing application palette:
51
+
52
+ ```css
53
+ :root {
54
+ --ith-table-brand: #0f766e; /* your primary colour */
55
+ }
56
+ ```
57
+
58
+ That is enough for light **and** dark mode — dark mode derives its own shades from the same
59
+ token. The default is `#5b21b6` (violet). A runtime theme (e.g. the user picks a colour in
60
+ settings) can set the same variable on the element:
61
+
62
+ ```html
63
+ <ith-table [style.--ith-table-brand]="userBrandColor()" [data]="rows" [columns]="cols"></ith-table>
64
+ ```
65
+
66
+ > Needs `color-mix()` (all evergreen browsers since 2023). Every derived token can still be
67
+ > overridden individually, which is what the rest of this guide documents.
68
+
69
+ ## Quick start
70
+
71
+ ```css
72
+ /* app-wide */
73
+ ith-table {
74
+ --ith-table-brand: #2563eb;
75
+ --ith-table-header-text: #e2e8f0;
76
+ --ith-table-radius: 8px;
77
+ --ith-table-cell-padding: 10px 14px;
78
+ }
79
+ ```
80
+
81
+ ```html
82
+ <ith-table class="orders-table" [data]="orders" [columns]="columns"></ith-table>
83
+ ```
84
+
85
+ ```css
86
+ .orders-table {
87
+ --ith-table-header-bg: #166534;
88
+ --ith-table-accent: #16a34a;
89
+ --ith-table-accent-soft: #dcfce7;
90
+ }
91
+ ```
92
+
93
+ ## Variable reference
94
+
95
+ These are public tokens: set them on `:root`, any ancestor, or the `ith-table` element itself.
96
+ They resolve on the component host with the light-mode defaults shown below.
97
+
98
+ ### Surfaces & text
99
+
100
+ | Variable | Light | Dark | Description |
101
+ | --- | --- | --- | --- |
102
+ | `--ith-table-bg` | `#ffffff` | `#161826` | Card and row background |
103
+ | `--ith-table-text` | `#1f2937` | `#e7e9f3` | Cell and header-row text |
104
+ | `--ith-table-muted` | `#6b7280` | `#9aa0b5` | Footer text, placeholders, icons |
105
+ | `--ith-table-border` | `#e8eaf0` | `#2a2e42` | Borders and separators |
106
+ | `--ith-table-footer-bg` | brand 2% + `#fff` | brand 4% + `#12141f` | Footer background |
107
+ | `--ith-table-filter-bg` | brand 3% + `#fff` | brand 6% + `#161826` | Filter row background |
108
+
109
+ ### Header
110
+
111
+ | Variable | Light | Dark | Description |
112
+ | --- | --- | --- | --- |
113
+ | `--ith-table-header-bg` | `var(--ith-table-brand)` | brand 42% + `#0b0d16` | Header bar background |
114
+ | `--ith-table-header-text` | `#ffffff` | `#f3eeff` | Header text and sort icons |
115
+
116
+ The header is a solid colour so it works with `stickyHeader`; use any CSS colour
117
+ (`#fff`, `rgb(...)`, `var(--brand)`). By default it *is* the brand colour (dark mode darkens it).
118
+
119
+ ### Accent & interaction
120
+
121
+ | Variable | Light | Dark | Description |
122
+ | --- | --- | --- | --- |
123
+ | `--ith-table-brand` | `#5b21b6` | `#7c3aed` | Base colour — every accent surface below derives from it |
124
+ | `--ith-table-accent` | `var(--ith-table-brand)` | brand 55% + `#fff` | Active page, checkboxes, links, action text |
125
+ | `--ith-table-accent-soft` | brand 12% + `#fff` | brand 26% + `#161826` | Badges, hover backgrounds |
126
+ | `--ith-table-hover` | brand 6% + `#fff` | brand 10% + `#161826` | Row hover |
127
+ | `--ith-table-selected-bg` | brand 10% + `#fff` | brand 20% + `#161826` | Selected row background |
128
+ | `--ith-table-striped-bg` | brand 2% + `#fff` | brand 4% + `#161826` | Zebra rows (`striped`) |
129
+ | `--ith-table-focus` | brand 25% + `transparent` | brand 38% + `transparent` | Focus ring (box-shadow) |
130
+
131
+ `brand X% + colour` means `color-mix(in srgb, var(--ith-table-brand) X%, colour)`: the brand is
132
+ mixed into that colour, so all of these follow a single `--ith-table-brand` change. Set any of
133
+ them individually to opt out of the derivation.
134
+
135
+ ### Inputs
136
+
137
+ | Variable | Light | Dark | Description |
138
+ | --- | --- | --- | --- |
139
+ | `--ith-table-input-bg` | `#ffffff` | `#1b1e30` | Search and filter input background |
140
+ | `--ith-table-input-border` | `#dfe3ec` | `#343a52` | Input border |
141
+ | `--ith-table-overlay` | `rgba(255,255,255,.72)` | `rgba(17,19,30,.72)` | Loading overlay |
142
+
143
+ ### Shape & spacing
144
+
145
+ | Variable | Default | Description |
146
+ | --- | --- | --- |
147
+ | `--ith-table-radius` | `14px` | Card border radius |
148
+ | `--ith-table-shadow` | soft shadow | Card shadow (`none` to remove) |
149
+ | `--ith-table-cell-padding` | `12px 16px` | Body cell padding |
150
+ | `--ith-table-font-size` | `14px` | Body font size |
151
+ | `--ith-table-header-font-size` | `13px` | Header font size |
152
+
153
+ ## Ready-made themes
154
+
155
+ ### Compact admin
156
+
157
+ ```css
158
+ .admin-table {
159
+ --ith-table-header-bg: #0f172a;
160
+ --ith-table-header-text: #e2e8f0;
161
+ --ith-table-accent: #2563eb;
162
+ --ith-table-accent-soft: #dbeafe;
163
+ --ith-table-hover: #f1f5f9;
164
+ --ith-table-selected-bg: #e0ecff;
165
+ --ith-table-radius: 8px;
166
+ --ith-table-cell-padding: 8px 12px;
167
+ --ith-table-font-size: 13px;
168
+ --ith-table-shadow: none;
169
+ }
170
+ ```
171
+
172
+ ### Bootstrap-friendly
173
+
174
+ ```css
175
+ [data-theme='bootstrap'] ith-table {
176
+ --ith-table-header-bg: #f8f9fa;
177
+ --ith-table-header-text: #212529;
178
+ --ith-table-accent: #0d6efd;
179
+ --ith-table-accent-soft: #cfe2ff;
180
+ --ith-table-hover: #f8f9fa;
181
+ --ith-table-selected-bg: #e7f1ff;
182
+ --ith-table-border: #dee2e6;
183
+ --ith-table-radius: 6px;
184
+ --ith-table-shadow: none;
185
+ }
186
+ ```
187
+
188
+ ### Soft purple (default look)
189
+
190
+ ```css
191
+ ith-table {
192
+ --ith-table-header-bg: #5b21b6;
193
+ --ith-table-accent: #6d28d9;
194
+ --ith-table-accent-soft: #ede9fe;
195
+ --ith-table-radius: 14px;
196
+ }
197
+ ```
198
+
199
+ ### Minimal
200
+
201
+ ```css
202
+ .minimal-table {
203
+ --ith-table-header-bg: #ffffff;
204
+ --ith-table-header-text: #111827;
205
+ --ith-table-border: #f1f5f9;
206
+ --ith-table-accent: #111827;
207
+ --ith-table-accent-soft: #f3f4f6;
208
+ --ith-table-radius: 0;
209
+ --ith-table-shadow: none;
210
+ --ith-table-cell-padding: 10px 0;
211
+ }
212
+ ```
213
+
214
+ ## Presentation modifiers
215
+
216
+ Toggle these inputs instead of writing CSS:
217
+
218
+ | Input | Effect |
219
+ | --- | --- |
220
+ | `[striped]="true"` | Zebra rows |
221
+ | `[bordered]="true"` | Vertical cell borders |
222
+ | `[dense]="true"` | Tighter padding and smaller type |
223
+ | `[hoverable]="false"` | Disable row hover |
224
+ | `[stickyHeader]="true"` | Keep the header visible while scrolling |
225
+ | `[maxHeight]="'480px'"` | Scroll inside the table instead of the page |
226
+
227
+ ```html
228
+ <ith-table
229
+ [data]="rows"
230
+ [columns]="columns"
231
+ [dense]="true"
232
+ [striped]="true"
233
+ [stickyHeader]="true"
234
+ maxHeight="480px">
235
+ </ith-table>
236
+ ```
237
+
238
+ Default (light) rendering:
239
+
240
+ ![Table overview](docs/images/table-overview.svg)
241
+
242
+ ## Scoping a theme
243
+
244
+ Because the variables inherit, you can theme a single table (or a whole section):
245
+
246
+ ```html
247
+ <section class="finance">
248
+ <ith-table [data]="invoices" [columns]="columns"></ith-table>
249
+ </section>
250
+ ```
251
+
252
+ ```css
253
+ .finance ith-table {
254
+ --ith-table-accent: #047857;
255
+ --ith-table-accent-soft: #d1fae5;
256
+ --ith-table-header-bg: #064e3b;
257
+ }
258
+ ```
259
+
260
+ Keep the `ith-table` element `display: block` (its default) and give it a width; the
261
+ internal scroll container handles overflow on narrow screens.
262
+
263
+ ## Accessibility
264
+
265
+ - Keep text/background contrast at WCAG AA. A dark header with light text and light rows
266
+ with dark text is the safest combination.
267
+ - Do not remove focus rings: `--ith-table-focus` is used for inputs, buttons and pagination.
268
+ - Meaning conveyed by `--ith-table-accent` (selected rows, active page) is also available
269
+ through checkboxes and `aria-current`, so colour is never the only signal.
270
+ - Respect `prefers-reduced-motion`; the component already disables transitions where needed.