TextArea
API reference › HTML › Form › TextArea
Renders the HTML <textarea> element for multiline plain-text input.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/textarea (BaseBlock for the base implementation.).
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attributes protected | mixed[] | HTML attributes array used by the implementing class. Default: []. | UIAwesome\ |
$content protected | string | Content string assigned to the element. Default: ''. | UIAwesome\ |
Methods
Section titled “Methods”Method details
Section titled “Method details”autocomplete()
Section titled “autocomplete() ”public function autocomplete(string|Stringable|UnitEnum|null $value): staticSets the autocomplete attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Autocomplete value, or null to remove the attribute. |
Returns
static: New instance with the updated autocomplete attribute.
cols()
Section titled “cols() ”public function cols(int|string|null $value): staticSets the cols attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int| | Visible width in average character widths (positive integer), or null to remove the attribute. |
Returns
static: New instance with the updated cols attribute.
Throws
InvalidArgumentException: if the provided value is not a positive integer.
dirname()
Section titled “dirname() ”public function dirname(string|Stringable|UnitEnum|null $value): staticSets the dirname attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Dirname value, or null to remove the attribute. |
Returns
static: New instance with the updated dirname attribute.
form()
Section titled “form() ”public function form(string|Stringable|UnitEnum|null $value): staticSets the form attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Form ID, or null to remove the attribute. |
Returns
static: New instance with the updated form attribute.
readonly()
Section titled “readonly() ”public function readonly(bool|null $value): staticSets the readonly attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | bool| | Readonly state. Use true to make readonly, false to make editable, or null to remove the attribute. |
Returns
static: New instance with the updated readonly attribute.
required()
Section titled “required() ”public function required(bool|null $value): staticSets the required attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | bool| | Required state. Use true to require a value, false to make it optional, or null to remove the attribute. |
Returns
static: New instance with the updated required attribute.
rows()
Section titled “rows() ”public function rows(int|string|null $value): staticSets the rows attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int| | Number of visible text lines (positive integer), or null to remove the attribute. |
Returns
static: New instance with the updated rows attribute.
Throws
InvalidArgumentException: if the provided value is not a positive integer.
wrap()
Section titled “wrap() ”public function wrap(string|UnitEnum|null $value): staticSets the wrap attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UnitEnum| | Line-wrapping behavior (‘hard’, ‘soft’, or ‘off’), or null to remove the attribute. |
Returns
static: New instance with the updated wrap attribute. Wrap for predefined enum values.
Throws
InvalidArgumentException: if the provided value is not valid.
getTag()
Section titled “getTag() ”protected function getTag(): UIAwesome\Html\Interop\BlockReturns the tag enumeration for the <textarea> element.