/Click feedback
Click feedback • CSS
Circle Surface Button
A circular CTA whose dark surface expands into an orange fill.
Installation
Terminal
npx shadcn@latest add https://microkit.co/r/circle-surface-button.jsonCode
TypeScript component
1export function CircleSurfaceButton() {2return <button type="button" className="circle-surface-button"><span>CLICK HERE</span><span aria-hidden="true" /></button>;3}
CSS
1.circle-surface-button {2position: relative;3display: grid;4width: 128px;5height: 128px;6place-items: center;7overflow: hidden;8border: 1px solid #f0f0f0;9border-radius: 50%;10background: transparent;11color: #f0f0f0;12cursor: pointer;13}14.circle-surface-button > span:first-child {15position: relative;16z-index: 1;17font-size: 13px;18transition: color .3s ease;19}20.circle-surface-button > span:last-child {21position: absolute;22inset: 0;23border-radius: inherit;24background: #323232;25transition: transform .5s cubic-bezier(.16, 1, .3, 1), background-color .5s ease;26}27.circle-surface-button:hover > span:first-child, .circle-surface-button:focus-visible > span:first-child {28color: #111;29}30.circle-surface-button:hover > span:last-child, .circle-surface-button:focus-visible > span:last-child {31background: #f97316;32transform: scale(1.1);33}34.circle-surface-button:focus-visible {35outline: 2px solid #f97316;36outline-offset: 4px;37}