JSFiddle - React, Tailwind, and code Playground
HTML
<div>Test test test test test test<div>asdasdasdasdasd</div></div>
CSS
div {
border: solid 2px blue;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 40px;
}