JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div id="app">
<transition name="fade">
<div v-if="switc" class="target">
<div style="background-color: pink; padding: 20px; margin-bottom: 20px;">
<p>
Text that could be of any length because it comes from a database.
</p>
<textarea style="resize: vertical;">
Textarea that the user can resize
</textarea>
</div>
</div>
</transition>
<button type="button" class="btn btn-secondary" @click="switc = !switc">
<span>Switch</span>
</button>
</div>
CSS
.fade-enter-to, .fade-leave {
max-height: 300px;
}
.fade-enter,
.fade-leave-to {
max-height: 0;
}
.target {
transition: all 0.5s;
/* overflow: hidden; */
}
JavaScript
var app = new Vue({
el: '#app',
data: {
switc: false
}
})