Skip to content

Commit fdf40cf

Browse files
Copilotkdinev
andauthored
docs(grids): clarify sizing guidance for CSS layout support
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-angular/sessions/4db7970d-eb66-4c96-a571-010d3be7c9ff Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
1 parent 631ea93 commit fdf40cf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • skills/igniteui-angular-grids/references

skills/igniteui-angular-grids/references/sizing.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
The grid uses **border-box sizing** — border and padding are included in the width/height calculations. Do **not** override `box-sizing` on the grid element; doing so will break size calculations.
1919

20-
Do **not** set `width` or `height` via CSS styles directly on the grid host element — always use the `width` and `height` **inputs** on the grid component.
20+
The grid supports both component inputs (`width`/`height`) and regular CSS/layout sizing from the host or wrapping container (including flex/grid layouts). Use the inputs when you need explicit grid sizing behavior such as `null` sizing that disables virtualization.
2121

2222
## Grid Width
2323

@@ -34,6 +34,7 @@ Do **not** set `width` or `height` via CSS styles directly on the grid host elem
3434
- All columns are rendered in the DOM — **column virtualization is disabled**.
3535
- Grid width expands to fit all column widths (minimum `136px` per column when no column widths are set).
3636
- No horizontal scrollbar inside the grid; the browser may render a native scrollbar if content overflows the viewport.
37+
- This is an edge-case mode intended when disabling column virtualization is desired; in layout-constrained containers (for example flex/grid wrappers), the expanding content width can break expected responsive sizing.
3738
- **Warning:** large column counts with `null` width can significantly impact browser performance due to no virtualization.
3839

3940
### Pixel Width
@@ -210,7 +211,7 @@ igx-grid {
210211

211212
## Key Rules
212213

213-
- **Never** set `width` or `height` directly as CSS styles on the grid host element — use the component `[width]` and `[height]` inputs.
214+
- Grid sizing can come from CSS/layout context (host/container sizing) or from `[width]`/`[height]` inputs. Use `null` width/height only intentionally, because it disables virtualization.
214215
- **Never** override `box-sizing` on the grid — it uses border-box and relies on this.
215216
- Use `null` for width/height only when the data set is small; virtualization is disabled and large data will hurt performance.
216217
- When using percentage height, the parent **must** have an explicit height for the percentage to resolve correctly. Without it, the grid falls back to 10 visible rows.

0 commit comments

Comments
 (0)