{%- set class = [
    'text',
    (class is defined and class ? class : null),
    (size is defined and size ? null : 'fullwidth')
]|filter|join(' ') %}

{%- set rows = (rows is defined ? rows : 2) %}
{%- set cols = (cols is defined ? cols : 50) -%}

<textarea class="{{ class }}" rows="{{ rows }}" cols="{{ cols }}"
    {%- if id is defined %} id="{{ id }}"{% endif %}
    {%- if name is defined %} name="{{ name }}"{% endif %}
    {%- if maxlength is defined and maxlength %} maxlength="{{ maxlength }}"{% endif %}
    {%- if showCharsLeft is defined and showCharsLeft %} data-show-chars-left{% endif %}
    {%- if autofocus is defined and autofocus and not craft.app.request.isMobileBrowser(true) %} autofocus{% endif %}
    {%- if readonly is defined and readonly %} readonly {% endif %}
    {%- if disabled is defined and disabled %} disabled{% endif %}
    {%- if placeholder is defined %} placeholder="{{ placeholder }}"{% endif %}
    {%- if block('attr') is defined %} {{ block('attr') }}{% endif %}>{{ value is defined ? value : null }}</textarea>
