# Grid Sizing

This feature attempts to address the need for a **Compact Grid**, which renders more items by utilizing the available space, mainly through setting smaller padding in its cells.

You can increase or decrease the size of the Grid by setting the `Size` attribute to a member of the [`Telerik.Blazor.ThemeConstants.Grid.Size`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.themeconstants.grid.size).Size class:

| Class members                 | Manual declarations |
| ----------------------------- | ------------------- |
| `Small`                       | `sm`                |
| `Medium` <br /> default value | `md`                |

> tip Changing the `Size` property affects different building blocks of the component (tables, buttons, inputs, dropdowns, and others).

> caption The built-in Size modes

<demo metaUrl="client/grid/sizing-size/" height="600"></demo>

## Notes

1. The `Size` option does not affect elements displayed inside a Popup (such as [Filter Menu](https://www.telerik.com/blazor-ui/documentation/components/grid/filter/filter-menu), [Column Menu](https://www.telerik.com/blazor-ui/documentation/components/grid/columns/menu), etc.). By design, all Popup elements are rendered on root level, so they are not technically inside the Grid. Thus, the `Size` option cannot propagate to them. To change the `Size` options of the elements inside Popups, you can use a template(where available), so you can override the built-in rendering. You can then add custom elements and explicitly specify their `Size`.

2. The `Size` option does not propagate to components rendered inside templates (this includes elements in [GridToolBar](https://www.telerik.com/blazor-ui/documentation/components/grid/toolbar), [CommandColumn](https://www.telerik.com/blazor-ui/documentation/components/grid/columns/command), etc.). To change the size of the elements in those components you have to set it explicitly.

> caption Set GridCommandButton Size option

```RAZOR.skip-repl
<TelerikGrid Size="@ThemeConstants.Grid.Size.Small">
    <GridToolBarTemplate>
        <GridCommandButton Size="@ThemeConstants.Button.Size.Small">Small Button</GridCommandButton>
    </GridToolBarTemplate>
    <GridColumns>
        <GridCommandColumn>
            <GridCommandButton Size="@ThemeConstants.Button.Size.Small">Small Button</GridCommandButton>
        </GridCommandColumn>
    </GridColumns>
</TelerikGrid>
```

## See Also

* [Grid Overview](https://www.telerik.com/blazor-ui/documentation/components/grid/overview)
* [Customize conditional and alternating row colors](https://www.telerik.com/blazor-ui/documentation/knowledge-base/grid-conditional-cell-background)
* [Live Demo: Grid Sizing](https://demos.telerik.com/blazor-ui/grid/sizing)
* [Blazor Grid](https://www.telerik.com/blazor-ui/documentation/components/grid/overview)
