---
id: "packages/active-grid/api/use-auto-size"
title: "useAutoSize"
description: "useAutoSize: generated from the source of active-grid."
url: "/packages/active-grid/api/use-auto-size"
locale: "en"
revision: "g0mvk5qxml-7b52bf0b:use-auto-size"
---

# useAutoSize

Exported by `@workspace/active-grid`. Generated from the package source; part of [the index of every export](/packages/active-grid/api).

## Functions, hooks and constants

**useAutoSize**: `<TData>(publicGrid: Grid<TData>, containerRef: RefObject<HTMLElement \| null>, options?: Partial<AutoSizeOptions> & { withAllColumnsMounted?: MeasurementPassRunner; }) => UseAutoSizeReturn`

Returns an object with:

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `autoSizeColumn` | `(columnId: string) => Promise<number>` | yes |  |
| `autoSizeAllColumns` | `(options?: { mode?: AutoSizeMode; lockAfterSize?: boolean; onLockColumns?: (columnIds: string[]) => void; }) => Promise<Record<string, number>>` | yes |  |
| `measureColumn` | `(columnId: string) => Promise<AutoSizeResult>` | yes |  |
| `resetCache` | `() => void` | yes |  |
