Characters: 0
npm install react-ascii-ui
import { AsciiTextarea } from 'react-ascii-ui';
export default function Example() {
const [value, setValue] = useState('');
return (
<AsciiTextarea
value={value}
onChange={(e) => setValue(e.target.value)}
placeholder="Enter your message..."
rows={4}
/>
);
}<AsciiTextarea
placeholder="Type your message here..."
rows={4}
/>const [value, setValue] = useState('Initial content');
<AsciiTextarea
value={value}
onChange={(e) => setValue(e.target.value)}
rows={3}
/><AsciiTextarea rows={2} placeholder="Small" />
<AsciiTextarea rows={8} placeholder="Large" /><AsciiTextarea
value="Disabled content"
disabled
rows={3}
/>| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | - | Current value of the textarea |
| onChange | (event) => void | - | Callback fired when content changes |
| placeholder | string | - | Placeholder text when empty |
| rows | number | 4 | Number of visible text lines |
| disabled | boolean | false | Whether the textarea is disabled |
| className | string | "" | Additional CSS classes |
AsciiTextarea extends all HTML textarea attributes and React.TextareaHTMLAttributes.