# field-sizing: content

Status: Baseline 2026 (Chrome 123, Safari 26.2, Firefox 152 in June 2026).  
Source: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/152 and https://webkit.org/blog/17640/webkit-features-for-safari-26-2/  
Page: https://designforai.dev/css/field-sizing

Makes inputs, textareas and selects size themselves to their content, so a textarea grows as the user types and an input is as wide as its value. Kills the auto-grow textarea JS snippet.

## HTML

```html
<label class="fx-031">Notes <textarea rows="2" placeholder="Type to grow"></textarea></label>
```

## CSS

```css
.fx-031 {
  font-family: system-ui;
  display: grid;
  gap: 4px;
  max-width: 400px
}
.fx-031 textarea {
  field-sizing: content;
  min-height: 2lh;
  max-height: 12lh;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 8px;
  resize: none
}
.fx-031 :is(a,button,input,select,textarea):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
```

Fallback: Unsupported browsers keep the fixed `rows` height with a scrollbar.

## Prompt

For auto-growing textareas and inputs use `field-sizing: content` with `min-height`/`max-height` in `lh` units for bounds; do not add input listeners that set `style.height`. Keep `rows`/`size` as the fallback size.
