JSFiddle - React, Tailwind, and code Playground

by Gaurav Singh

HTML

<div class="container">
    <div class="checkbox"></div>
    <div class="name">Some text</div>
    <div class="value">1</div>
</div>
<div class="container">
    <div class="checkbox"></div>
    <div class="name">Some text</div>
    <div class="value">12345</div>
</div>
<div class="container">
    <div class="checkbox"></div>
    <div class="name">Some text very long text still longer very very long text</div>
    <div class="value">12345</div>
</div>
<div class="container">
    <div class="checkbox"></div>
    <div class="name">Some text very long text still longer very very long text</div>
    <div class="value">1234567890</div>
</div>

CSS

.container {
    width: 300px;
    height: 30px;
    background-color: #B7B7B7;
    display: flex;
    flex-wrap: wrap;
    align-items: center
}

.checkbox {
    width: 15px;
    height: 15px;
    margin: 5px;
    background-color: green;
}

.name {
    height: 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    background-color: orange;
    flex: 1;
}

.value {
    height: 20px;
    background-color: LightCyan;
    margin-right: 5px;
}