Textarea

A multi-line text input.

Pass a string as value; onChange returns the next value and the event.

Live example

Example controls

Usage

'use client';

import { Textarea } from '@prosazhin/pbcomponents';
import { useState } from 'react';

function Example() {
  const [value, setValue] = useState('');
  return (
    <Textarea
      value={value}
      onChange={setValue}
      placeholder='Placeholder'
    />
  );
}

Component API

PropType / variantsPurposeDefault
size's' | 'm's · mComponent size.m
disabledbooleanDisables interaction.false
errorbooleanShows the error state.false
placeholderstringHint in an empty field.—
valuestringCurrent value of a controlled component.—
onChange(value: string, event: InputEvent) => voidReports the new text and input event.—
classNamestringClass of the root element.—
wrapperClassNamestringClass of the outer wrapper.—
rowsnumberNumber of visible rows.—

Native HTML attributes are accepted where the component renders the corresponding element. className props only affect styling.