/Click feedback
Click feedback • CSS
See More Swap Button
A pill button whose arrow circle swaps sides while its surface changes color.
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/see-more-swap-button.jsonCode
TypeScript component
1import { ArrowDown } from "lucide-react";23export function SeeMoreSwapButton() {4return (5<button type="button" className="see-more-swap-button">6<span className="see-more-swap-content">7<span className="see-more-swap-icon see-more-swap-icon-left" aria-hidden="true">8<ArrowDown size={20} strokeWidth={2.4} />9</span>10<span className="see-more-swap-label">See more</span>11<span className="see-more-swap-icon see-more-swap-icon-right" aria-hidden="true">12<ArrowDown size={20} strokeWidth={2.4} />13</span>14</span>15</button>16);17}
CSS
1.see-more-swap-button {2box-sizing: border-box;3appearance: none;4display: inline-flex;5align-items: center;6justify-content: center;7width: 196px;8overflow: hidden;9border: 0;10border-radius: 999px;11background: #f0f0f0;12padding: 12px 16px;13color: #101016;14font-family: Arial, Helvetica, sans-serif;15cursor: pointer;16transition: background-color .5s cubic-bezier(.16, 1, .3, 1), color .5s cubic-bezier(.16, 1, .3, 1);17}18.see-more-swap-content {19position: relative;20display: flex;21height: 40px;22width: 100%;23align-items: center;24justify-content: center;25}26.see-more-swap-label {27position: relative;28z-index: 1;29white-space: nowrap;30text-align: center;31font-size: 16px;32font-weight: 500;33line-height: normal;34transform: translateX(16px);35transition: transform .5s cubic-bezier(.16, 1, .3, 1);36}37.see-more-swap-icon {38position: absolute;39display: grid;40width: 40px;41height: 40px;42place-items: center;43border-radius: 50%;44transition: transform .5s cubic-bezier(.16, 1, .3, 1);45}46.see-more-swap-icon-left {47left: 0;48background: #101016;49color: #fff;50}51.see-more-swap-icon-right {52right: 0;53background: #fff;54color: #101016;55transform: translateX(64px);56}57.see-more-swap-button:hover,58.see-more-swap-button:focus-visible {59background: #22222d;60color: #f0f0f0;61}62.see-more-swap-button:hover .see-more-swap-icon-left,63.see-more-swap-button:focus-visible .see-more-swap-icon-left {64transform: translateX(-64px);65}66.see-more-swap-button:hover .see-more-swap-icon-right,67.see-more-swap-button:focus-visible .see-more-swap-icon-right {68transform: translateX(0);69}70.see-more-swap-button:hover .see-more-swap-label,71.see-more-swap-button:focus-visible .see-more-swap-label {72transform: translateX(-16px);73}74.see-more-swap-button:focus-visible {75outline: 2px solid #f97316;76outline-offset: 4px;77}