JSFiddle - React, Tailwind, and code Playground

HTML

<h1><span>Texte</span></h1>

CSS

h1 {position:relative;text-align:center}
h1 span {padding:0 5px;background:#fff}
h1:before {content:"";position:absolute;width:100%;top:50%;left:0;border-top:1px solid;z-index:-1}