JSFiddle - React, Tailwind, and code Playground

HTML

<div class="wrap">
    <a class="open" href="#">open</a>
    <div class="outer">
        <div class="slide">
            <a href="#">One</a>
            <a href="#">a</a>
            <a href="#">uaoeua</a>
            <a href="#">aoeue</a>
            <a href="#">aaoeeo</a>
        </div>
    </div>
</div>

CSS

.wrap {
    position: relative;
    left: 50px;
    top: 20px;
}
.outer {
    height: 40px;
    position: relative;
    overflow: hidden;
}
.slide {
    border-radius: 19px 19px 19px 19px;
    position: absolute;
    top: 0;
    right: 0;
    background-color: black;
    height: 40px;
}
a {
    color: gray;
    line-height: 35px;
    float: left;
    outline: none;
}
.slide a { 
    float: left;
    display: block;
    padding: 0 10px;
}
.slide > :first-child {
    padding-left: 15px;
}
.slide > :last-child {
    padding-right: 45px;
}
.open {
    position: absolute;
    right: -25px;
    top: 0;
    background-color: black;
    border-radius: 19px 19px 19px 19px;
    height: 40px;
    padding: 0 15px;
    z-index: 5;
}

JavaScript

var w = 0;

$('.slide').children().each(function() {
    w += $(this).outerWidth();
});

$('.outer').width(w+5);
$('.wrap').width(w);
$('.slide').css('left', w);

$('.open').toggle(function() {
    $('.slide').stop().animate({
        left: 0
    });
    $(this).html('close');
}, function() {
    $('.slide').stop().animate({
        left: w
    });
    $(this).html('open');
});