Skip to content

Textarea

A textarea that grows with its content on a spring and shows its budget as a short meter beside a rolling counter in the help row: bone while there is room, accent in the last tenth, error past the limit; going over is marked invalid but never blocked.

Download
Customize

Install

npx shadcn@latest add https://obsydeui.com/r/textarea.json

Usage

Import it from where the CLI puts it, or copy the files below by hand.

import { Textarea } from '@/components/obsyde/ember/textarea/Textarea';

export function Example() {
  return (
    <Textarea label="Message" placeholder="Write something" />
  );
}

Files

Plain React, TypeScript and CSS. No dependencies. The download keeps these paths.

  • ember/textarea/Textarea.tsxcomponent
  • ember/textarea/textarea.cssstyles
  • ember/textarea/TextareaDemo.tsxdemo
  • ember/shared/rolling-number.cssshared
  • ember/shared/RollingNumber.tsxshared
  • ember/shared/spring.tsshared
  • ember/shared/accent.tsshared
  • ember/forms-kit/kit.tsxshared
  • ember/shared/ember.cssshared

API

PropTypeDefault
accentAccent'ember' | 'volt' | 'arc''ember'
labelLabelstring'Message'
placeholderPlaceholderstring'Write something'
maxLengthBudget (0 = none)number0
minRowsMin rowsnumber3
maxRowsMax rowsnumber8
disabledDisabledbooleanfalse