Skip to content

Textarea

An element to enter multi-line plain-text content.

Showcase

import { Textarea } from '@klnjs/react-textarea'
import classes from './textarea.module.css'
export default () => <Textarea autosize className={classes.textarea} />

Features

  • Controlled or uncontrolled.

  • Autosizing with min and max rows.

Installation

Terminal window
bun install @klnjs/react-textarea

Components

Textarea

Use the autosize prop to enable the textarea to grow and shrink to fit its content. Use the minRows and maxRows props to set the minimum and maximum number of rows the textarea can have.

PropTypeDefault
asChild
boolean
false
value
string
-
defaultValue
string
-
autosize
boolean
true
minRows
number
2
maxRows
number
Infinity
onChange
(value: string) => void
-