defuss-shadcn / Website / Events & Promotions / speaker-item
Speaker ItemBLK
Introduces one speaker with a portrait, role, and biography - with their talk, as a card, a featured keynote or a compact row. Part of the Events & Promotions blocks.
On this page (5)
§Keynote
data-variant='featured': the keynote - a 4:5 portrait beside the bio, larger type, a keynote label, the topics as tags and the speaker's links (.mk-speaker-item-social: icon links, each named by aria-label).
§Grid
Default: a square grayscale portrait that turns to color on hover or focus, name, role, a link to the talk and the topic as a tag.
§Overlay
data-variant='overlay': the portrait fills a 3:4 card, the topics and the name sit over a scrim; on hover or focus the picture leans in, the talk rises and the speaker's links appear in the corner (always shown on touch screens).
§Compact
data-variant='compact': a round portrait with name, role and talk on one row - for agendas and sidebars.
§CSS view file
/* -- Speaker Item (website · Events & Promotions) ------------------------- Introduces one speaker with a portrait, role, and biography - with their talk, as a card, a featured keynote or a compact row. */@layer components { /* every box in the block measures border-box - the same on any page */ :where(.mk-speaker-item, .mk-speaker-item *, .mk-speaker-item ::before, .mk-speaker-item ::after) { box-sizing: border-box; } .mk-speaker-item { display: flex; flex-direction: column; gap: 0.875rem; } .mk-speaker-item-photo { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-xl); background: var(--muted); filter: grayscale(1) contrast(1.05); transition: filter 300ms ease; } .mk-speaker-item:hover .mk-speaker-item-photo, .mk-speaker-item:focus-within .mk-speaker-item-photo { filter: none; } .mk-speaker-item-body { display: grid; gap: 0.25rem; } .mk-speaker-item-name { margin: 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; } .mk-speaker-item-role { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; } .mk-speaker-item-bio { margin: 0.5rem 0; color: var(--muted-foreground); line-height: 1.65; text-wrap: pretty; } .mk-speaker-item-talk { display: inline-flex; align-items: flex-start; gap: 0.375rem; margin-block-start: 0.375rem; color: var(--primary); font-size: 0.875rem; font-weight: 600; text-decoration: none; line-height: 1.4; & svg { flex: none; width: 0.875rem; height: 0.875rem; margin-block-start: 0.15rem; } &:hover { text-decoration: underline; text-underline-offset: 3px; } &:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); } } .mk-speaker-item[data-variant="featured"] { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); align-items: center; gap: 2rem; padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); color: var(--card-foreground); & .mk-speaker-item-photo { aspect-ratio: 4 / 5; filter: none; } & .mk-speaker-item-name { font-size: 1.75rem; letter-spacing: -0.02em; } & .mk-speaker-item-role { font-size: 1rem; } } .mk-speaker-item-keynote { width: fit-content; margin-block-end: 0.5rem; padding: 0.125rem 0.625rem; border-radius: 999px; background: var(--foreground); color: var(--background); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; } .mk-speaker-item[data-variant="compact"] { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.875rem; & .mk-speaker-item-photo { width: 3.5rem; height: 3.5rem; border-radius: 50%; filter: none; } & .mk-speaker-item-body { gap: 0; } & .mk-speaker-item-name { font-size: 0.9375rem; } & .mk-speaker-item-talk { margin: 0.125rem 0 0; font-size: 0.8125rem; } } /* topics as tags - in any variant */ .mk-speaker-item-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.25rem 0 0; padding: 0; list-style: none; & li { padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--secondary); color: var(--secondary-foreground); font-size: 0.75rem; font-weight: 600; } } /* where else to find the speaker - icon links, each named by its aria-label */ .mk-speaker-item-social { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.5rem 0 0; padding: 0; list-style: none; & a { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted-foreground); transition: color 150ms ease, background-color 150ms ease; &:hover { background: var(--accent); color: var(--accent-foreground); } &:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; } } & svg { width: 0.9375rem; height: 0.9375rem; } } /* overlay: the portrait fills the card, the name over a scrim; the talk and the links come up on hover */ .mk-speaker-item[data-variant="overlay"] { position: relative; isolation: isolate; display: grid; align-content: end; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius-xl); background: var(--muted); color: #fff; &::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 30%, oklch(0.14 0.02 260 / 0.55) 55%, oklch(0.12 0.02 260 / 0.92)); } & .mk-speaker-item-photo { position: absolute; inset: 0; z-index: -2; height: 100%; aspect-ratio: auto; border-radius: 0; transition: filter 300ms ease, scale 600ms cubic-bezier(0.2, 0.7, 0.2, 1); } &:is(:hover, :focus-within) .mk-speaker-item-photo { scale: 1.05; } & .mk-speaker-item-body { gap: 0.3rem; padding: 1.25rem; } & .mk-speaker-item-name { font-size: 1.375rem; letter-spacing: -0.02em; } & .mk-speaker-item-role { color: oklch(1 0 0 / 0.78); } & .mk-speaker-item-tags li { background: oklch(1 0 0 / 0.16); color: #fff; backdrop-filter: blur(6px); } & .mk-speaker-item-talk { color: #fff; opacity: 0; translate: 0 0.5rem; transition: opacity 250ms ease, translate 250ms ease; } & .mk-speaker-item-social { position: absolute; top: 0.75rem; right: 0.75rem; margin: 0; opacity: 0; translate: 0 -0.5rem; transition: opacity 250ms ease, translate 250ms ease; & a { border-color: oklch(1 0 0 / 0.25); background: oklch(0.12 0.02 260 / 0.45); color: #fff; backdrop-filter: blur(8px); &:hover { background: #fff; color: oklch(0.15 0.02 260); } } } &:is(:hover, :focus-within) :is(.mk-speaker-item-talk, .mk-speaker-item-social) { opacity: 1; translate: 0 0; } } /* no hover on touch: everything shows */ @media (hover: none) { .mk-speaker-item[data-variant="overlay"] :is(.mk-speaker-item-talk, .mk-speaker-item-social) { opacity: 1; translate: 0 0; } } /* -- Accessibility ------------------------------------------- */ @media (prefers-reduced-motion: reduce) { .mk-speaker-item[data-variant="overlay"] :is(.mk-speaker-item-photo, .mk-speaker-item-talk, .mk-speaker-item-social) { transition: none; } .mk-speaker-item-photo { transition: none; } } @media (forced-colors: active) { .mk-speaker-item[data-variant="featured"] { border-color: CanvasText; } }}Comments, ideas or improvements? Edit this page's source on GitHub