Textarea
The textarea component is a multi-line text field input that can be used to receive longer chunks of text from the user in the form of a comment box, description field, and more.
Loading...
<twig:Textarea placeholder="Type your message here." />
Installation
bin/console ux:install textarea --kit flowbite-4
That's it!
Install the following Composer dependencies:
composer require tales-from-a-dev/twig-tailwind-extra:^1.0.0
Copy the following file(s) into your Symfony app:
templates/components/Textarea.html.twig
{# @block content The initial textarea value #}
<textarea
class="{{ ('bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full p-3.5 shadow-xs placeholder:text-body ' ~ attributes.render('class'))|tailwind_merge }}"
{{ attributes }}
>
{%- block content %}{% endblock -%}
</textarea>
Happy coding!
Usage
<twig:Textarea />
Examples
Default
Loading...
<twig:Textarea placeholder="Type your message here." class="max-w-sm" />
Disabled
Loading...
<twig:Textarea placeholder="Type your message here." disabled class="max-w-sm" />
With Label
Loading...
<div class="grid w-sm gap-1.5">
<twig:Label for="message">Your message</twig:Label>
<twig:Textarea id="message" placeholder="Type your message here." />
</div>
API Reference
Textarea
| Block | Description |
|---|---|
content |
The initial textarea value |