/Click feedback
Click feedback • CSS
Sliding Arrow Label
A text label that gets a bright surface while an arrow slides in beside it.
Installation
Requires lucide-react for its icons. The shadcn CLI installs it for you; copying the code by hand means installing it yourself.
Terminal
npx shadcn@latest add https://microkit.co/r/sliding-arrow-label.jsonCode
TypeScript component
1import { ArrowRight } from "lucide-react";23export function SlidingArrowLabel() {4return <button type="button" className="sliding-arrow-label"><span className="sliding-arrow-label-copy">Create a blog</span><span className="sliding-arrow-label-icon" aria-hidden="true"><ArrowRight size={16} strokeWidth={2.4} /></span></button>;5}
CSS
1.sliding-arrow-label {2position: relative;3display: inline-flex;4align-items: center;5overflow: hidden;6border: 0;7background: transparent;8padding-right: 24px;9color: #f0f0f0;10cursor: pointer;11}12.sliding-arrow-label-copy {13border-radius: 8px;14padding: 4px 12px;15font-size: 16px;16font-weight: 500;17transition: background-color .3s ease, color .3s ease;18}19.sliding-arrow-label-icon {20position: absolute;21right: 0;22display: flex;23width: 16px;24opacity: 0;25transform: translateX(-10px);26transition: opacity .2s ease, transform .35s cubic-bezier(.16, 1, .3, 1);27}28.sliding-arrow-label:hover .sliding-arrow-label-copy, .sliding-arrow-label:focus-visible .sliding-arrow-label-copy {29background: #f97316;30color: #111;31}32.sliding-arrow-label:hover .sliding-arrow-label-icon, .sliding-arrow-label:focus-visible .sliding-arrow-label-icon {33opacity: 1;34transform: translateX(0);35}36.sliding-arrow-label:focus-visible {37outline: 2px solid #f97316;38outline-offset: 4px;39}