/Click feedback
Click feedback • CSS
Contact Details Reveal
A compact white contact label that shifts upward to reveal muted contact details with an orange accent.
Installation
Terminal
npx shadcn@latest add https://microkit.co/r/contact-details-reveal.jsonCode
TypeScript component
1import "./styles.css";23export function ContactDetailsReveal() {4return (5<button type="button" className="contact-details-reveal">6<span className="contact-details-reveal__dot" aria-hidden="true" />7<span className="contact-details-reveal__content">8<span className="contact-details-reveal__title">Contact us</span>9<span className="contact-details-reveal__detail">hello@contactus.com</span>10</span>11</button>12);13}
CSS
1.contact-details-reveal,2.contact-details-reveal * {3box-sizing: border-box;4}5.contact-details-reveal {6appearance: none;7position: relative;8display: inline-flex;9width: min(190px, calc(100vw - 40px));10height: 54px;11align-items: center;12justify-content: center;13overflow: hidden;14border: 0;15background: transparent;16padding: 0;17color: #f7f7fa;18font-family: Arial, Helvetica, sans-serif;19text-align: left;20cursor: pointer;21}22.contact-details-reveal__dot {23position: relative;24flex: none;25width: 14px;26height: 14px;27border-radius: 50%;28background: #f7f7fa;29transform: translate(18px, 0);30transition: background-color .32s ease, transform .42s cubic-bezier(.16, 1, .3, 1);31}32.contact-details-reveal__content {33position: relative;34width: 145px;35height: 46px;36margin-left: 15px;37transform: translateX(18px);38}39.contact-details-reveal__title,40.contact-details-reveal__detail {41position: absolute;42left: 0;43white-space: nowrap;44}45.contact-details-reveal__title {46top: 50%;47font-size: 19px;48font-weight: 400;49letter-spacing: -.55px;50line-height: 1;51transform: translateY(-50%);52transition: top .42s cubic-bezier(.16, 1, .3, 1), transform .42s cubic-bezier(.16, 1, .3, 1);53}54.contact-details-reveal__detail {55top: 30px;56color: #77777d;57font-size: 12px;58font-weight: 400;59letter-spacing: -.2px;60line-height: 1;61opacity: 0;62transform: translateY(15px);63transition: opacity .24s ease .05s, transform .42s cubic-bezier(.16, 1, .3, 1);64}65.contact-details-reveal:hover .contact-details-reveal__dot,66.contact-details-reveal:focus-visible .contact-details-reveal__dot {67background: #f97316;68transform: translate(18px, 4px);69}70.contact-details-reveal:hover .contact-details-reveal__title,71.contact-details-reveal:focus-visible .contact-details-reveal__title {72top: 6px;73transform: translateY(0);74}75.contact-details-reveal:hover .contact-details-reveal__detail,76.contact-details-reveal:focus-visible .contact-details-reveal__detail {77opacity: 1;78transform: translateY(0);79}80.contact-details-reveal:focus-visible {81border-radius: 8px;82outline: 2px solid #f97316;83outline-offset: 4px;84}85@media (prefers-reduced-motion: reduce) {86.contact-details-reveal__dot,87.contact-details-reveal__title,88.contact-details-reveal__detail {89transition: none;90}91}