Textarea
A bare multi-line text input — the native <textarea> is this component's own root element. It has no built-in label/hint/error; wrap it in FormField for that chrome. Works standalone too — not every textarea needs the full form suite.
Docs: https://platform.behivetech.com/behivetech/atoms/textarea
Usage
import { Textarea } from '@behivetech/atoms.textarea';
import { FormField } from '@behivetech/forms.form-field';
const [value, setValue] = useState('');
<Textarea value={value} onChange={(e) => setValue(e.target.value)} />
<FormField label="Bio" htmlFor="bio" hint="Max 200 characters.">
<Textarea id="bio" rows={3} />
</FormField>
Pass invalid (adds the --invalid modifier and sets aria-invalid) to visually mark the field as invalid (pair with FormField's error prop for the message).
On React Native
The same Textarea renders in an Expo app through the react-native export condition, as a multiline TextInput in the same block; style is className there, and it takes TextInput's props.
- Height.
rows (4 by default) is passed to React Native as numberOfLines, which the platforms read differently: Android draws the field that many lines tall from the start, and iOS, where a multiline field is as tall as its text, lets it grow to that many lines and then scrolls. For a field that starts taller on iOS, give it a minHeight in style. The first line sits at the top, right under the field's padding: the field has no lineHeight on native (on iOS a line height on an input puts the extra room above each line), so do not give it one in style.
- Focus and disabled. A focused field takes the primary border with an inner outline (the web's focus ring); an invalid one keeps the error color.
disabled, or editable={false}, makes the field uneditable, dims it and announces it as disabled.
invalid is announced. It draws the error border, and because React Native has no invalid state, the field says invalidLabel ("Invalid entry" by default; pass your translation) as its accessibility hint, before a hint of your own. Inside a FormField, the field announces the error text itself when it appears or changes.
- Name. React Native has no
htmlFor: give the field an accessibilityLabel.