Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


      <div id="app" class="w-100 bg-gray-100 pt-36 h-screen">
          <div class="flex m-auto max-w-3xl mb-6">
            <div>Some chat content</div>
          <div class="flex m-auto max-w-3xl">
              <div ref="textAreaContainer" class="relative flex-grow items-center">
                      placeholder="start typing"
                      class="absolute rounded border border-gray-300 px-3 py-2 resize-none w-full bottom-0 outline-none focus:border-blue-500 hover:border-blue-500"
              <div class="flex items-center justify-center h-11 w-24 bg-blue-200 ml-2 rounded font-bold cursor-pointer hover:bg-blue-400">send ></div>




                var vm = new Vue({
    el: '#app',
    data() {
        return {
            textAreaMaxHeight: 0,
            textareaInline: {
                maxHeight: "30vh",
                overflow: "hidden",
                height: "2.75rem",
    created() {
        window.addEventListener("resize", this.setTextAreaMax);
    destroyed() {
        window.removeEventListener("resize", this.setTextAreaMax);
    mounted() {
    methods: {
        setTextAreaMax() {
            let convTextArea = this.$refs.conversationTextArea;
            let compStyles = window.getComputedStyle(convTextArea);
            this.textAreaMaxHeight = compStyles.getPropertyValue("max-height");
        manageTextAreaHeight(e) {
            let ele =;
            this.textareaInline.height = "auto";

            Vue.nextTick(() => {
                this.textareaInline.height = ele.offsetHeight - 2 === ele.scrollHeight? "2.75rem": `${ele.scrollHeight + 10}px`;
                this.$refs.textAreaContainer.height = ele.scrollHeight + 10;

                let calcMaxHeight = parseInt(this.textAreaMaxHeight.replace("px", ""));
                if (ele.scrollHeight + 10 >= calcMaxHeight) {
                    this.textareaInline.overflow = "auto";
                } else {
                    this.textareaInline.overflow = "hidden";