Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Talks Accordion About Block for React

The talks of a conference app's team as accordion rows under an Upcoming and Past switch: a title, the event, the kind of talk and when, opening to the abstract, the speaker and a Slides link.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A speaking page for React with Base UI, written for Lecternly, a fictional conference app. A compact header has an Upcoming and Past switch at its end, and the chosen list of four talks is a set of accordion rows ruled from rail to rail. A closed row shows the title with the event, a badge for the kind of talk (keynote, panel, workshop or lightning talk) and when; an open one shows the abstract, the speaker, and a Slides link once the talk has happened. The first row of each list is open on load. Both lists share one grid cell with an unseen copy, so switching never moves the page, and the list is the block's last band. It's built from Tabs, Accordion, Badge and Guides, with CSS for the entrance and your theme's tokens for every colour. For about pages and team pages that want to show what the team talks about without a calendar. The talks and speakers are example data.

FAQ

How do I change the talks?

UPCOMING and PAST at the top of the file are lists of talks: a title, an event, a kind, a speaker, an abstract and how it reads. An upcoming talk also has a date (month and day) for its time element. Keep four in each list so the two panels are about the same height; the first row of each opens on load (OPEN_UPCOMING, OPEN_PAST).

How do the rows behave with a keyboard?

Each row's title is a button inside a heading: Enter or Space opens and closes it, and more than one can be open. Tab moves between the rows. The arrow keys don't move between the rows; use Tab.

How does the Upcoming and Past switch work?

They are the library's tabs: one tab stop, the arrow keys move between them, and the list of the chosen tab follows. Both lists, with their first rows open, are stacked unseen under the open one, hidden from assistive technology and inert, so the tallest sets the height and switching never moves the page. Base UI selects a tab as it takes focus.

Why do past talks say how long ago and not a date?

A date goes stale on a page nobody edits. Upcoming talks show a month and day in a time element; past ones say how long ago in the words you write in the data. These are fixed text, not computed from today, so update them when you update the list.

How does it fit on a phone?

The switch takes the full width under the header and the rows stack: title, then the event, kind and day. The plus becomes a minus when a row is open. Nothing scrolls sideways at 320 pixels, and in a right-to-left layout the Slides arrow turns around.

What moves, and what happens with reduced motion?

The header and the list fade up once on load, the plus turns into a minus, and the answer opens with the library's height transition. With reduced motion the entrance and the turn are off. Base UI and React Aria's panels ignore reduced motion for the height change, so say so if your page needs it off.

  • Pro

    Podcast Show Notes About

    Press and recognition

    Show notes for a podcast hosting company's own show: a scrolling vertical list of eight episodes at the start and the chosen episode's notes at the end, with a summary, chapters drawn to scale and listed with time stamps, and a Listen link.

  • Pro

    Month Calendar Events About

    Culture and values

    The standing events of an event hosting company drawn as a month at a glance with no month name: a seven by five table of days with the recurring events marked by shape, and the same events as a dated agenda with a Subscribe link.

  • Pro

    Citable Publications About

    Press and recognition

    A bibliography for a research platform: eight publications as a numbered list in citation form, a type filter, and a Cite button on each row that copies the reference.

  • Pro

    Sortable Media Mentions About

    Press and recognition

    An index of eight press mentions for a PR tool as two-line rows, each with the masthead, the kind of piece, the day and the headline as a link, and the reach at its end; a Select sorts them by newest or by reach.

  • Pro

    Paper Viewer About

    Press and recognition

    A paper viewer for a lab data platform: a vertical list of five papers at the start and the chosen paper drawn as a framed page at the end, with its venue, title, authors, abstract and one key figure.

  • Pro

    A pricing-philosophy section for a usage-billing company: four promises as accordion rows, each opening to a receipt whose lines, averages and cap are computed from the same numbers.