Skip to content

[UTextarea] Proposal: Add fixedRows prop to limit input to fixed number of rows #5886

@yeonjulee1005

Description

@yeonjulee1005

Environment


  • Operating System: Darwin
  • Node Version: v24.5.0
  • Nuxt Version: 4.1.3
  • CLI Version: 3.30.0
  • Nitro Version: 2.12.9
  • Package Manager: bun@1.3.3
  • Builder: -
  • User Config: modules, imports, devtools, app, css, colorMode, mdc, ui, runtimeConfig, build, sourcemap, compatibilityDate, nitro, vite, typescript, eslint, image, mongoose, pinia, stylelint, supabase, vueuse
  • Runtime Modules: @nuxt/eslint@1.9.0, @nuxtjs/supabase@1.6.2, @nuxtjs/mdc@0.18.2, @vueuse/nuxt@13.9.0, @nuxt/image@1.11.0, @nuxt/scripts@0.11.13, @nuxt/test-utils@3.19.2, @nuxtjs/stylelint-module@5.2.1, @nuxtjs/color-mode@3.5.2, @nuxt/ui@4.1.0, nuxt-mongoose@1.0.6, @vueuse/nuxt@13.9.0, @pinia/nuxt@0.11.3, pinia-plugin-persistedstate/nuxt@4.7.1
  • Build Modules: -

Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.x

Version

v4.1.0

Reproduction

https://ui.nuxt.com/docs/components/textarea#autoresize

Description

Currently, the maxrows prop only works when autoresize is enabled, limiting the maximum number of rows a textarea can grow to. However, there's no way to set a fixed number of rows that should always be displayed and prevent input beyond that number of lines.

Add a new fixedRows prop that:

  • Always displays exactly the specified number of rows
  • Automatically prevents input beyond the specified number of lines
  • Works independently of autoresize
  • Automatically applies overflow-hidden and resize-none styles to prevent scrolling and resizing

This feature would be useful when:

  • You need consistent vertical spacing in forms where multiple textareas should always occupy the same space
  • You want to limit input to a specific number of lines
  • UI design requires fixed-height textareas

Example Usage

<!-- Always show 5 rows and prevent input beyond 5 lines -->
<UTextarea fixedRows="5" v-model="value" />

<!-- Current behavior: can grow up to 5 rows with autoresize -->
<UTextarea autoresize maxrows="5" v-model="value" />

I'll try to submit a PR (fix) for this sometime this week! 🤗

default.mov
2026-01-15.10.42.48.mov

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting initial review and prioritizationv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions