JSFiddle - React, Tailwind, and code Playground

by Derek Leung

HTML

<ul>
    <li>FOO<span>BAR</span></li>
    <li>BUTTON<span>More info</span></li>
</ul>

CSS

ul{
    list-style: none;
    width: 300px;
    height: 300px;
    border: 1px solid black;
    padding: 10px;
}
li{
    display: inline-block;
    float: right;
    clear: both;
    border-radius: 20px;
    border: 1px solid black;
    padding: 10px;
    min-width: 0%;
    margin-bottom: 10px;
    
    transition: all 0.3s ease;
}
li > span{
    color: gray;
    margin-left: 5px;
    opacity: 0;
    
    transition: opacity 0.3s ease;
}
li:hover{
    min-width: 100%;
}
li:hover > span{
    opacity: 1;
}

*{
    box-sizing: border-box;
}