field-sizing

A modern property that allows form fields (like textareas) to automatically grow or shrink based on the amount of text typed into them, without needing JavaScript.

Quick example

textarea {
  /* Textarea will grow automatically as the user types */
  field-sizing: content;
  min-height: 3em;
}

Quick facts

Initial value
fixed
Inherited
No
Applies to
elements with a default preferred size
Animation type
discrete

Values

contentfixed

field-sizing Browser Support

Limited availability 75% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Not ready for production without a fallback.

123+
26.2+
123+
ESC