Textarea

Bootstrap textarea

Note: We are transitioning MDB4 to a legacy version and focusing on developing MDB5. While we'll continue to support for the transition period, we encourage you to migrate to MDB5. We're offering a huge discount on MDB5 PRO to help with your transition, enabling you to leverage the full potential of the latest version. You can find more information here.
upgrade with discount

A 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

Take a look at the following Bootstrap textarea examples:


Default textarea

        
            

            <div class="form-group">
              <label for="exampleFormControlTextarea1">Large textarea</label>
              <textarea class="form-control rounded-0" id="exampleFormControlTextarea1" rows="10"></textarea>
            </div>

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

          
        
    

Material textarea

        
            

            <!--Material textarea-->
            <div class="md-form">
              <textarea id="form7" class="md-textarea form-control" rows="3"></textarea>
              <label for="form7">Material textarea</label>
            </div>
            <!--Textarea with icon prefix-->
            <div class="md-form">
              <i class="fas fa-pencil-alt prefix"></i>
              <textarea id="form10" class="md-textarea form-control" rows="3"></textarea>
              <label for="form10">Icon Prefix</label>
            </div>
          
        
    

Textarea with a colorful border

With our textarea you can use different types of colors to customize your textarea.

Also, please check out our documentation about colors.

Default textarea

        
            

            <div class="form-group purple-border">
              <label for="exampleFormControlTextarea4">Colorful border</label>
              <textarea class="form-control" id="exampleFormControlTextarea4" rows="3"></textarea>
            </div>

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

          
        
    
        
            
              .purple-border textarea {
                border: 1px solid #ba68c8;
            }
            .purple-border .form-control:focus {
                border: 1px solid #ba68c8;
                box-shadow: 0 0 0 0.2rem rgba(186, 104, 200, .25);
            }

            .green-border-focus .form-control:focus {
                border: 1px solid #8bc34a;
                box-shadow: 0 0 0 0.2rem rgba(139, 195, 74, .25);
            }
          
        
    

Material textarea

        
            

            <!--Material textarea-->
            <div class="md-form mb-4 pink-textarea active-pink-textarea">
              <textarea id="form18" class="md-textarea form-control" rows="3"></textarea>
              <label for="form18">Material textarea colorful on :focus state</label>
            </div>

            <!--Material textarea-->
            <div class="md-form amber-textarea active-amber-textarea">
              <textarea id="form19" class="md-textarea form-control" rows="3"></textarea>
              <label for="form19">Material textarea colorful on :focus state</label>
            </div>
            <!--Basic textarea-->
            <div class="md-form mb-4 pink-textarea active-pink-textarea-2">
              <textarea id="form17" class="md-textarea form-control" rows="3"></textarea>
              <label for="form17">Material textarea always colorful</label>
            </div>

            <!--Basic textarea-->
            <div class="md-form amber-textarea active-amber-textarea-2">
              <textarea id="form16" class="md-textarea form-control" rows="3"></textarea>
              <label for="form16">Material textarea always colorful</label>
            </div>

          
        
    
        
            

            .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;
            }
            .active-pink-textarea.md-form textarea.md-textarea:focus:not([readonly])+label {
              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-amber-textarea.md-form textarea.md-textarea:focus:not([readonly])+label {
              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 textarea.md-textarea:focus:not([readonly])+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;
            }
            .active-amber-textarea-2.md-form textarea.md-textarea:focus:not([readonly])+label {
              color: #ffa000;
            }
            
          
        
    

Textarea with rounded corners

        
            

        <div class="form-group">
          <label for="exampleFormControlTextarea3">Rounded corners</label>
          <textarea class="form-control" id="exampleFormControlTextarea3" rows="7"></textarea>
        </div>

      
        
    

Textarea with shadow and placeholder

        
            

        <div class="form-group 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>

      
        
    
        
            

          .shadow-textarea textarea.form-control::placeholder {
            font-weight: 300;
        }
        .shadow-textarea textarea.form-control {
            padding-left: 0.8rem;
        }
      
        
    

Material textarea with a colorful prefix

        
            
        <!--Textarea with icon prefix-->
        <div class="md-form mb-4 pink-textarea active-pink-textarea">
          <i class="fas fa-angle-double-right prefix"></i>
          <textarea id="form21" class="md-textarea form-control" rows="3"></textarea>
          <label for="form21">Material textarea with a colorful prefix on :focus state</label>
        </div>

        <!--Textarea with icon prefix-->
        <div class="md-form amber-textarea active-amber-textarea">
          <i class="fas fa-pencil-alt prefix"></i>
          <textarea id="form22" class="md-textarea form-control" rows="3"></textarea>
          <label for="form22">Material textarea with a colorful prefix on :focus state</label>
        </div>
        <!--Textarea with icon prefix-->
        <div class="md-form mb-4 pink-textarea active-pink-textarea-2">
          <i class="fas fa-angle-double-right prefix"></i>
          <textarea id="form23" class="md-textarea form-control" rows="3"></textarea>
          <label for="form23">Material textarea with an always colorful prefix</label>
        </div>

        <!--Textarea with icon prefix-->
        <div class="md-form amber-textarea active-amber-textarea-2">
          <i class="fas fa-pencil-alt prefix"></i>
          <textarea id="form24" class="md-textarea form-control" rows="3"></textarea>
          <label for="form24">Material textarea with an always colorful prefix</label>
        </div>
      
        
    
        
            

        .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-pink-textarea.md-form textarea.md-textarea:focus:not([readonly])+label {
          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-amber-textarea.md-form textarea.md-textarea:focus:not([readonly])+label {
          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-pink-textarea-2.md-form textarea.md-textarea:focus:not([readonly])+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;
        }
        .active-amber-textarea-2.md-form .prefix {
          color: #ffa000;
        }
        .active-amber-textarea-2.md-form textarea.md-textarea:focus:not([readonly])+label {
          color: #ffa000;
        }

      
        
    

Textarea within forms MDB Pro component

Notification

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

Contact Us

Contact Us

        
            

        <!-- Section: form gradient -->
        <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-weight-bold">Contact Us</h3>
              </div>

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

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

              <div class="md-form">
                <i class="fas 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="fas 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="fas 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="fas fa-pencil-alt prefix grey-text"></i>
                <textarea id="form107" class="md-textarea form-control" rows="5"></textarea>
                <label for="form107">Your message</label>
              </div>


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

                <!--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: form gradient -->
        <!-- Section: form dark -->
        <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).webp');">
            <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-weight-bold text-uppercase"><strong>Contact</strong> <a class="green-text font-weight-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 id="form103" class="md-textarea form-control" rows="5"></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>
        <!-- Section: form dark -->

      
        
    
        
            
          .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-gradient .md-form textarea.md-textarea:focus:not([readonly])+label {
            color: #4f4f4f;
          }


          .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;
          }
          .form-dark .md-form textarea.md-textarea:focus:not([readonly])+label {
            color: #fff;
          }
      
        
    

Textarea within a 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.
        
            

        <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.webp"
            alt="Avatar">
          <div class="media-body">
            <h5 class="mt-0 font-weight-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.webp"
                alt="Generic placeholder image">
              <div class="media-body">
                <h5 class="mt-0 font-weight-bold blue-text">Danny Tatuum</h5>
                <div class="form-group basic-textarea rounded-corners">
                  <textarea class="form-control z-depth-1" id="exampleFormControlTextarea345" 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.webp"
            alt="Avatar">
          <div class="media-body">
            <h5 class="mt-0 font-weight-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>

      
        
    
        
            

          .media .avatar {
            width: 64px;
        }
        .shadow-textarea textarea.form-control::placeholder {
            font-weight: 300;
        }
        .shadow-textarea textarea.form-control {
            padding-left: 0.8rem;
        }