JSFiddle - React, Tailwind, and code Playground

HTML

<div class="container">
  <textarea name="" id="" cols="30" rows="10"></textarea>
  <div class="counter">
    <span class="current">0</span>&nbsp;/
    <span class="total">360</span>
  </div>
</div>

CSS

.container {
  position: relative;
  width: max-content;
}

.counter {
  position: absolute;
  bottom: 5px;
  right: 5px;
}

JavaScript

const textarea = document.querySelector('textarea');
const counter = document.querySelector('.current');
const maxlength = 360;

textarea.addEventListener('input', onInput)

function onInput(event) {
	event.target.value = event.target.value.substr(0, maxlength);
  const length = event.target.value.length;
  counter.textContent = length;
}