JSFiddle - React, Tailwind, and code Playground

HTML

<h2>title</h2>

CSS

@import url('https://fonts.googleapis.com/css2?family=Neucha&display=swap');


* {
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Neucha', cursive;
}
h2 {
  display: flex;
  align-items: center;
  width: 80%;
  margin: 20px auto;
}
h2::after {
  flex-grow: 1;
  content: "";
  height: 1px;
  background: #f00;
}