Sign in


Sign up


Bootstrap Textarea

Bootstrap textarea is an input dedicated for a large volume of text. It may be used in a variety of components like forms, comment sections and forums.

Textareas don't have to be boring. They can be enhanced with colors, shadows or rounded corners.

Examples of Bootstrap textarea use:

  • Comment section
  • Form
  • Forums

See the following Bootstrap textarea examples:


Basic textarea

                
.basic-textarea textarea {
    height: auto;
}
                
            
                
<div class="form-group basic-textarea">
    <label for="exampleFormControlTextarea1">Large textarea</label>
    <textarea class="form-control" id="exampleFormControlTextarea1" rows="10"></textarea>
</div>

<div class="form-group basic-textarea">
    <label for="exampleFormControlTextarea2">Small textarea</label>
    <textarea class="form-control" id="exampleFormControlTextarea2" rows="3"></textarea>
</div>
                
            

Textarea with rounded corners

                
.basic-textarea textarea {
    height: auto;
}
.rounded-corners textarea {
    border-radius: 0.25rem;
}
                
            
                
<div class="form-group basic-textarea rounded-corners">
    <label for="exampleFormControlTextarea3">Rounded corners</label>
    <textarea class="form-control" id="exampleFormControlTextarea3" rows="7"></textarea>
</div>
                
            

Textarea with colorful border

                
.basic-textarea textarea {
    height: auto;
}
.rounded-corners textarea {
    border-radius: 0.25rem;
}
.purple-border textarea {
    border: 1px solid #ba68c8;
}
.green-border-focus .form-control:focus {
    border: 1px solid #8bc34a;
}
                
            
                
<div class="form-group basic-textarea rounded-corners purple-border">
    <label for="exampleFormControlTextarea4">Colorful border</label>
    <textarea class="form-control" id="exampleFormControlTextarea4" rows="3"></textarea>
</div>

<div class="form-group basic-textarea green-border-focus">
    <label for="exampleFormControlTextarea5">Colorful border on <code>:focus</code> state</label>
    <textarea class="form-control" id="exampleFormControlTextarea5" rows="3"></textarea>
</div>
                
            

Textarea with shadow and placeholder

                
.shadow-textarea textarea.form-control::placeholder {
    font-weight: 300;
}
.shadow-textarea textarea.form-control {
    padding-left: 0.8rem;
}
                
            
                
<div class="form-group basic-textarea rounded-corners shadow-textarea">
    <label for="exampleFormControlTextarea6">Shadow and placeholder</label>
    <textarea class="form-control z-depth-1" id="exampleFormControlTextarea6" rows="3" placeholder="Write something here..."></textarea>
</div>
                
            

Material textarea

                
<!--Material textarea-->
<div class="md-form">
    <textarea type="text" id="form7" class="md-textarea"></textarea>
    <label for="form7">Material textarea</label>
</div>

<!--Textarea with icon prefix-->
<div class="md-form">
    <i class="fa fa-pencil prefix"></i>
    <textarea type="text" id="form10" class="md-textarea"></textarea>
    <label for="form10">Icon Prefix</label>
</div>
                
            

Material textarea with colorful border

                
.pink-textarea textarea.md-textarea:focus:not([readonly]) {
    border-bottom: 1px solid #f48fb1;
    box-shadow: 0 1px 0 0 #f48fb1;
}
.active-pink-textarea.md-form label.active {
    color: #f48fb1;
}

.amber-textarea textarea.md-textarea:focus:not([readonly]) {
    border-bottom: 1px solid #ffa000;
    box-shadow: 0 1px 0 0 #ffa000;
}
.active-amber-textarea.md-form label.active {
    color: #ffa000;
}


.active-pink-textarea-2 textarea.md-textarea {
    border-bottom: 1px solid #f48fb1;
    box-shadow: 0 1px 0 0 #f48fb1;
}
.active-pink-textarea-2.md-form label.active {
    color: #f48fb1;
}
.active-pink-textarea-2.md-form label {
    color: #f48fb1;
}


.active-amber-textarea-2 textarea.md-textarea {
    border-bottom: 1px solid #ffa000;
    box-shadow: 0 1px 0 0 #ffa000;
}
.active-amber-textarea-2.md-form label.active {
    color: #ffa000;
}
.active-amber-textarea-2.md-form label {
    color: #ffa000;
}
                
            
                
<!--Material textarea-->
<div class="md-form mb-r pink-textarea active-pink-textarea">
    <textarea type="text" id="form18" class="md-textarea"></textarea>
    <label for="form18">Material textarea</label>
</div>

<!--Material textarea-->
<div class="md-form mb-r amber-textarea active-amber-textarea">
    <textarea type="text" id="form19" class="md-textarea"></textarea>
    <label for="form19">Material textarea</label>
</div>

<!--Basic textarea-->
<div class="md-form mb-r pink-textarea active-pink-textarea-2">
    <textarea type="text" id="form17" class="md-textarea"></textarea>
    <label for="form17">Material textarea</label>
</div>

<!--Basic textarea-->
<div class="md-form mb-r amber-textarea active-amber-textarea-2">
    <textarea type="text" id="form16" class="md-textarea"></textarea>
    <label for="form16">Material textarea</label>
</div>
                
            

Material textarea with colorful prefix

                
.active-pink-textarea.md-form label.active {
    color: #f48fb1;
}
.pink-textarea textarea.md-textarea:focus:not([readonly]) {
    border-bottom: 1px solid #f48fb1;
    box-shadow: 0 1px 0 0 #f48fb1;
}
.pink-textarea.md-form .prefix.active {
    color: #f48fb1;
}

.active-amber-textarea.md-form label.active {
    color: #ffa000;
}
.amber-textarea textarea.md-textarea:focus:not([readonly]) {
    border-bottom: 1px solid #ffa000;
    box-shadow: 0 1px 0 0 #ffa000;
}
.amber-textarea.md-form .prefix.active {
    color: #ffa000;
}

.active-pink-textarea-2 textarea.md-textarea {
    border-bottom: 1px solid #f48fb1;
    box-shadow: 0 1px 0 0 #f48fb1;
}
.active-pink-textarea-2.md-form label.active {
    color: #f48fb1;
}
.active-pink-textarea-2.md-form label {
    color: #f48fb1;
}
.active-pink-textarea-2.md-form .prefix {
    color: #f48fb1;
}

.active-amber-textarea-2 textarea.md-textarea {
    border-bottom: 1px solid #ffa000;
    box-shadow: 0 1px 0 0 #ffa000;
}
.active-amber-textarea-2.md-form label.active {
    color: #ffa000;
}
.active-amber-textarea-2.md-form label {
    color: #ffa000;
}
.active-amber-textarea-2.md-form .prefix {
    color: #ffa000;
}
                
            
                
<!--Textarea with icon prefix-->
<div class="md-form pink-textarea active-pink-textarea">
    <i class="fa fa-angle-double-right prefix"></i>
    <textarea type="text" id="form21" class="md-textarea"></textarea>
    <label for="form21">Material textarea with colorful prefix on <code>:focus</code> state</label>
</div>

<!--Textarea with icon prefix-->
<div class="md-form amber-textarea active-amber-textarea">
    <i class="fa fa-pencil prefix"></i>
    <textarea type="text" id="form22" class="md-textarea"></textarea>
    <label for="form22">Material textarea with colorful prefix on <code>:focus</code> state</label>
</div>
<!--Textarea with icon prefix-->
<div class="md-form pink-textarea active-pink-textarea-2">
    <i class="fa fa-angle-double-right prefix"></i>
    <textarea type="text" id="form23" class="md-textarea"></textarea>
    <label for="form23">Material textarea with prefix always colorful</label>
</div>

<!--Textarea with icon prefix-->
<div class="md-form amber-textarea active-amber-textarea-2">
    <i class="fa fa-pencil prefix"></i>
    <textarea type="text" id="form24" class="md-textarea"></textarea>
    <label for="form24">Material textarea with prefix always colorful</label>
</div>
                
            

Textarea within forms MDB Pro component

Info notification

MDB has many forms to use together with textarea. Take a look here to know all the possibilities.

Contact Us

Contact Us

                
.form-gradient .header {
  border-top-left-radius: .3rem;
  border-top-right-radius: .3rem; }

.form-gradient input[type=text]:focus:not([readonly]) {
  border-bottom: 1px solid #fd9267;
  box-shadow: 0 1px 0 0 #fd9267; }

.form-gradient input[type=text]:focus:not([readonly]) + label {
  color: #4f4f4f; }

.form-gradient textarea.md-textarea:focus:not([readonly]) {
    border-bottom: 1px solid #fd9267;
    box-shadow: 0 1px 0 0 #fd9267; }


.form-dark .md-form label {
  color: #fff; }

.form-dark input[type=text]:focus:not([readonly]) {
  border-bottom: 1px solid #00C851;
  -webkit-box-shadow: 0 1px 0 0 #00C851;
  box-shadow: 0 1px 0 0 #00C851; }

.form-dark input[type=text]:focus:not([readonly]) + label {
  color: #fff; }

.form-dark textarea.md-textarea:focus:not([readonly]) {
    border-bottom: 1px solid #00C851;
    box-shadow: 0 1px 0 0 #00C851;
    color: #fff; }

.form-dark textarea.md-textarea  {
    color: #fff;
}

.form-dark .form-control, .form-dark .form-control:focus {
    color: #fff;
}
                
            
                
<section class="form-gradient mb-5">

    <!--Form with header-->
    <div class="card">

        <!--Header-->
        <div class="header peach-gradient">

            <div class="row d-flex justify-content-center">
                <h3 class="white-text mb-0 py-5 font-bold">Contact Us</h3>
            </div>

        </div>
        <!--Header-->

        <div class="card-body mx-4 mt-4">

            <div class="md-form">
                <i class="fa fa-user prefix grey-text"></i>
                <input type="text" id="form104" class="form-control">
                <label for="form104">Your name</label>
            </div>

            <div class="md-form">
                <i class="fa fa-envelope prefix grey-text"></i>
                <input type="text" id="form105" class="form-control">
                <label for="form105">Your email</label>
            </div>

            <div class="md-form">
                <i class="fa fa-tag prefix grey-text"></i>
                <input type="text" id="form106" class="form-control">
                <label for="form106">Subject</label>
            </div>

            <div class="md-form">
                <i class="fa fa-pencil prefix grey-text"></i>
                <textarea type="text" id="form107" class="md-textarea" style="height: 100px"></textarea>
                <label for="form107">Your message</label>
            </div>


            <!--Grid row-->
            <div class="row d-flex align-items-center mb-3">

                <!--Grid column-->
                <div class="col-md-12">
                    <div class="text-center">
                        <button type="button" class="btn btn-grey btn-rounded z-depth-1a">Send</button>
                    </div>
                </div>
                <!--Grid column-->

            </div>
            <!--Grid row-->
        </div>

    </div>
    <!--/Form with header-->

</section>

<section class="form-dark mb-5">

    <!--Form without header-->
    <div class="card card-image" style="background-image: url('https://mdbootstrap.com/img/Photos/Others/pricing-table%20(7).jpg');">
        <div class="text-white rgba-stylish-strong py-5 px-5 z-depth-4">

            <!--Header-->
            <div class="text-center">
                <h3 class="white-text mb-5 mt-4 font-bold font-up"><strong>Contact</strong> <a class="green-text font-bold"><strong> Us</strong></a></h3>
            </div>

            <div class="md-form">
                <input type="text" id="form100" class="form-control">
                <label for="form100">Your name</label>
            </div>

            <div class="md-form">
                <input type="text" id="form101" class="form-control">
                <label for="form101">Your email</label>
            </div>

            <div class="md-form">
                <input type="text" id="form102" class="form-control">
                <label for="form102">Subject</label>
            </div>

            <div class="md-form">
                <textarea type="text" id="form103" class="md-textarea" style="height: 100px;"></textarea>
                <label for="form103">Your message</label>
            </div>

            <!--Grid row-->
            <div class="row d-flex align-items-center">

                <!--Grid column-->
                <div class="text-center col-md-12 mt-3 mb-2">
                    <button type="button" class="btn btn-success btn-block btn-rounded z-depth-1">Send</button>
                </div>
                <!--Grid column-->
            </div>
            <!--Grid row-->

        </div>
    </div>
    <!--/Form without header-->

</section>
                
            

Textarea within comments list MDB Pro component

Avatar
Anna Smith
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
Generic placeholder image
Danny Tatuum
Avatar
Caroline Horwitz
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis odit minima eaque dignissimos recusandae officiis commodi nulla est, tempore atque voluptas non quod maxime, iusto, debitis aliquid? Iure ipsum, itaque.
                
.media .avatar {
    width: 64px;
}
.shadow-textarea textarea.form-control::placeholder {
    font-weight: 300;
}
.shadow-textarea textarea.form-control {
    padding-left: 0.8rem;
}
                
            
                
<div class="media">
    <img class="d-flex rounded-circle avatar z-depth-1-half mr-3" src="https://mdbootstrap.com/img/Photos/Avatars/avatar-5.jpg" alt="Avatar">
    <div class="media-body">
        <h5 class="mt-0 font-bold blue-text">Anna Smith</h5>
        Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.

        <div class="media mt-3 shadow-textarea">
            <img class="d-flex rounded-circle avatar z-depth-1-half mr-3" src="https://mdbootstrap.com/img/Photos/Avatars/avatar-8.jpg" alt="Generic placeholder image">
            <div class="media-body">
                <h5 class="mt-0 font-bold blue-text">Danny Tatuum</h5>
                <div class="form-group basic-textarea rounded-corners">
                    <textarea class="form-control z-depth-1" id="exampleFormControlTextarea3" rows="3" placeholder="Write your comment..."></textarea>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="media">
    <img class="d-flex rounded-circle avatar z-depth-1-half mr-3" src="https://mdbootstrap.com/img/Photos/Avatars/avatar-10.jpg" alt="Avatar">
    <div class="media-body">
        <h5 class="mt-0 font-bold blue-text">Caroline Horwitz</h5>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis odit minima eaque dignissimos recusandae officiis commodi nulla est, tempore atque voluptas non quod maxime, iusto, debitis aliquid? Iure ipsum, itaque.
    </div>
</div>