Two-Line Label Swap
A primary link label moves out and a supporting message slides into its place.
A primary link label moves out and a supporting message slides into its place.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<a class="tbx-1073" href="#demo" aria-label="Learn more about our work">
<span class="tbx-1073__viewport" aria-hidden="true"><span>Our Work</span><span>View Projects</span></span>
<span class="tbx-1073__arrow" aria-hidden="true">↗</span>
</a>
.tbx-1073{display:flex;align-items:center;justify-content:space-between;gap:16px;width:min(268px,100%);padding:20px 20px;color:#224358;background:#fff;border-bottom:2px solid #bacbd3;text-decoration:none;font:700 18px/1.2 system-ui,sans-serif;transition:border-color .35s}
.tbx-1073__viewport{height:24px;overflow:hidden;display:grid;min-width:0}
.tbx-1073__viewport span{grid-area:1/1;transition:transform .38s cubic-bezier(.22,1,.36,1),opacity .28s;white-space:nowrap}
.tbx-1073__viewport span:nth-child(2){transform:translateY(120%);opacity:0;color:#147d7f}
.tbx-1073__arrow{font-size:25px;font-weight:400;transition:transform .35s,color .35s}
.tbx-1073:is(:hover,:focus-visible){border-color:#147d7f}.tbx-1073:is(:hover,:focus-visible) .tbx-1073__viewport span:first-child{transform:translateY(-125%);opacity:0}
.tbx-1073:is(:hover,:focus-visible) .tbx-1073__viewport span:nth-child(2){transform:translateY(0);opacity:1}
.tbx-1073:is(:hover,:focus-visible) .tbx-1073__arrow{transform:translate(3px,-3px);color:#147d7f}
.tbx-1073:focus-visible{outline:3px solid #e2b470;outline-offset:4px}
@media(prefers-reduced-motion:reduce){.tbx-1073,.tbx-1073 *{transition:none!important}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for links sections and navigation menus.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile: Ensure the interactive content remains accessible without hover on touch devices.
Browser: Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion: Check that prefers-reduced-motion is respected.