Interactivity

field-sizing

Utilities for controlling the sizing of form controls.

ClassStyles
field-sizing-fixed
field-sizing: fixed;
field-sizing-content
field-sizing: content;

Examples

Sizing based on content

Use the field-sizing-content utility to allow a form control to adjust it's size based on the content:

Type in the input below to see the size change

<textarea class="field-sizing-content ..." rows="2">  Latex Salesman, Vanderlay Industries</textarea>

Using a fixed size

Use the field-sizing-fixed utility to make a from control use a fixed size:

Type in the input below to see the size remain the same

<textarea class="field-sizing-fixed w-80 ..." rows="2">  Latex Salesman, Vanderlay Industries</textarea>

Responsive design

Prefix a field-sizing utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

<input class="field-sizing-content md:field-sizing-fixed ..." />

Learn more about using variants in the variants documentation.

Copyright © 2025 Tailwind Labs Inc.·Trademark Policy

Tailwind CSS 中文网(本网站)的目标是为中文开发者提供准确、及时的 Tailwind CSS 中文文档

Tailwind CSS 中文文档由本网站维护人员共同翻译,采用 MIT 开源协议发布

本网站与 tailwindcss.com 及 Tailwind Labs Inc. 并无从属关系

Tailwind 商标由 Tailwind Labs Inc. 所有

京ICP备15031610号-8