/Navigation
Navigation • CSS
Social Highlight Cards
Social cards with a luminous top rail, a soft brand-colored wash, and matching icons on hover.
Installation
Terminal
npx shadcn@latest add @microkit/social-highlight-cardsCode
TypeScript component
1import "./social-highlight-cards.css";23import type { CSSProperties } from "react";45const socials = [6{ label: "Henrique Barone on LinkedIn", href: "https://www.linkedin.com/in/hbarone/", highlight: "#0a66c2", icon: "linkedin" },7{ label: "Henrique Barone on GitHub", href: "https://github.com/henriquegpb", highlight: "light-dark(#14181e,#f0f0f0)", icon: "github" },8{ label: "Henrique Barone on Instagram", href: "https://www.instagram.com/henrique_barone/", highlight: "#e4405f", icon: "instagram" },9];1011function SocialIcon({ name = "linkedin" }) {12if (name === "linkedin") {13return <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M5.1 3.5a2.1 2.1 0 1 0 0 4.2 2.1 2.1 0 0 0 0-4.2ZM3.3 8.9h3.6V20H3.3V8.9Zm5.8 0h3.4v1.5h.1c.5-.9 1.6-1.9 3.5-1.9 3.7 0 4.4 2.4 4.4 5.6V20h-3.6v-5.1c0-1.2 0-2.8-1.7-2.8s-2 1.3-2 2.7V20H9.1V8.9Z" /></svg>;14}1516if (name === "github") {17return <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M12 2C6.48 2 2 6.58 2 12.23c0 4.52 2.87 8.35 6.84 9.7.5.1.68-.22.68-.5v-1.9c-2.78.62-3.36-1.2-3.36-1.2-.46-1.19-1.11-1.5-1.11-1.5-.91-.64.07-.63.07-.63 1 .08 1.53 1.06 1.53 1.06.9 1.57 2.35 1.12 2.92.86.09-.67.35-1.12.64-1.38-2.22-.26-4.56-1.14-4.56-5.06 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.31.1-2.74 0 0 .84-.28 2.75 1.05A9.36 9.36 0 0 1 12 6.84c.85 0 1.7.12 2.5.34 1.91-1.33 2.75-1.05 2.75-1.05.55 1.43.2 2.48.1 2.74.64.72 1.03 1.63 1.03 2.75 0 3.93-2.34 4.8-4.57 5.06.36.32.68.94.68 1.89v2.8c0 .28.18.6.69.5A10.25 10.25 0 0 0 22 12.23C22 6.58 17.52 2 12 2Z" /></svg>;18}1920return <svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="5" stroke="currentColor" strokeWidth="2" /><circle cx="12" cy="12" r="4" stroke="currentColor" strokeWidth="2" /><circle cx="17.4" cy="6.6" r="1.2" fill="currentColor" /></svg>;21}2223export function SocialHighlightCards() {24return (25<nav className="social-highlight-cards" aria-label="Social links">26{socials.map((social) => (27<a28className="social-highlight-card"29href={social.href}30key={social.href}31target="_blank"32rel="noreferrer"33title={social.label}34aria-label={social.label}35style={{ color: social.highlight, "--social-highlight": social.highlight } as CSSProperties}36>37<span className="social-highlight-card__glow" aria-hidden="true" />38<span className="social-highlight-card__beam" aria-hidden="true" />39<span className="social-highlight-card__icon"><SocialIcon name={social.icon} /></span>40</a>41))}42</nav>43);44}
CSS
1.social-highlight-cards {2display: flex;3align-items: center;4justify-content: center;5gap: 14px;6}7.social-highlight-card {8position: relative;9isolation: isolate;10display: grid;11width: 64px;12height: 64px;13place-items: center;14overflow: hidden;15border: 1px solid light-dark(rgba(20, 24, 30, .09), rgba(255, 255, 255, .09));16border-radius: 6px;17background: light-dark(#ffffff,#16171d);18box-shadow:19inset 0 1px 0 light-dark(rgba(20, 24, 30, .035), rgba(255, 255, 255, .035)),200 1px 0 light-dark(rgba(20, 24, 30, .08), rgba(255, 255, 255, .08));21text-decoration: none;22transition:23border-color 480ms cubic-bezier(.22, 1, .36, 1),24background-color 480ms cubic-bezier(.22, 1, .36, 1),25box-shadow 480ms cubic-bezier(.22, 1, .36, 1);26}27.social-highlight-card__glow {28position: absolute;29z-index: -1;30inset: 0;31background: radial-gradient(32ellipse 78% 92% at 50% -4%,33color-mix(in srgb, currentColor 38%, transparent) 0%,34color-mix(in srgb, currentColor 16%, transparent) 38%,35transparent 76%36);37opacity: .2;38transition: opacity 480ms cubic-bezier(.22, 1, .36, 1);39}40.social-highlight-card__beam {41position: absolute;42top: 4px;43right: 8px;44left: 8px;45height: 4px;46border-radius: 999px;47background: currentColor;48opacity: .3;49transform: scaleX(.96);50transition:51transform 480ms cubic-bezier(.22, 1, .36, 1),52opacity 480ms cubic-bezier(.22, 1, .36, 1);53}54.social-highlight-card__icon {55display: grid;56width: 30px;57height: 30px;58place-items: center;59color: light-dark(#dde0e6,#0d0e13);60opacity: .82;61transform: scale(.96);62transition:63color 480ms cubic-bezier(.22, 1, .36, 1),64opacity 480ms cubic-bezier(.22, 1, .36, 1),65transform 480ms cubic-bezier(.22, 1, .36, 1);66}67.social-highlight-card__icon svg {68width: 100%;69height: 100%;70}71.social-highlight-card:hover,72.social-highlight-card:focus-visible {73border-color: color-mix(in srgb, currentColor 28%, light-dark(rgba(20, 24, 30, .08), rgba(255, 255, 255, .08)));74background: light-dark(#f0f2f5,#181920);75box-shadow:76inset 0 1px 0 light-dark(rgba(20, 24, 30, .06), rgba(255, 255, 255, .06)),770 10px 24px light-dark(rgba(246, 247, 249, .28), rgba(0, 0, 0, .28)),780 0 22px color-mix(in srgb, var(--social-highlight) 12%, transparent);79}80.social-highlight-card:hover .social-highlight-card__glow,81.social-highlight-card:focus-visible .social-highlight-card__glow {82opacity: 1;83}84.social-highlight-card:hover .social-highlight-card__beam,85.social-highlight-card:focus-visible .social-highlight-card__beam {86opacity: 1;87transform: scaleX(1);88}89.social-highlight-card:hover .social-highlight-card__icon,90.social-highlight-card:focus-visible .social-highlight-card__icon {91color: inherit;92opacity: 1;93transform: scale(1);94}95.social-highlight-card:focus-visible {96outline: 2px solid currentColor;97outline-offset: 4px;98}99@media (max-width: 420px) {100.social-highlight-cards {101gap: 10px;102}103.social-highlight-card {104width: 56px;105height: 56px;106}107.social-highlight-card__icon {108width: 27px;109height: 27px;110}111}112@media (prefers-reduced-motion: reduce) {113.social-highlight-card,114.social-highlight-card__glow,115.social-highlight-card__beam,116.social-highlight-card__icon {117transition-duration: .01ms;118}119}