@k8ordo/ui

Textarea

A multi-line text field. With autoResize, its height follows the text.

Import

ts
import { Textarea } from '@k8ordo/ui';

Usage

tsx
<Textarea
  id="textarea-basic"
  aria-describedby={undefined}
  disabled={false}
  invalid={false}
  required={false}
  placeholder="Enter text"
/>

Rows

tsx
<Textarea
  id="textarea-rows"
  aria-describedby={undefined}
  disabled={false}
  invalid={false}
  required={false}
  placeholder="6 rows"
  rows={6}
/>

Auto resize

tsx
<Textarea
  id="textarea-auto"
  aria-describedby={undefined}
  autoResize
  disabled={false}
  invalid={false}
  required={false}
  placeholder="Type to auto-resize"
/>

Disabled

tsx
<Textarea
  id="textarea-disabled"
  aria-describedby={undefined}
  disabled
  invalid={false}
  required={false}
  placeholder="Disabled"
/>

Invalid

tsx
<Textarea
  id="textarea-invalid"
  aria-describedby={undefined}
  disabled={false}
  invalid
  required={false}
  defaultValue="invalid value"
/>

Props

autoResize?
Type: boolean
Default: false
children?
Type: ReactNode
Default: -
fullHeight?
Type: boolean
Default: false
invalid?
Type: boolean
Default: false
ref?
Type: Ref<HTMLTextAreaElement>
Default: -
type?
Type: string
Default: -
PropTypeDefault
autoResize?booleanfalse
children?ReactNode-
fullHeight?booleanfalse
invalid?booleanfalse
ref?Ref<HTMLTextAreaElement>-
type?string-

Inherited attributes (except the ones set internally): TextareaHTMLAttributes<HTMLTextAreaElement>

k8ordo

React libraries that use Baseline features without holding back.