Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Quiet Hours Heatmap FAQ Block for React

A gym FAQ whose first answer is a heatmap of busy-ness, seven days by twelve hours in one colour at five strengths, with a legend and a worked-out line, above six membership questions.

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

An FAQ for React with Base UI. A start-aligned header sits over seven questions that run from rail to rail in hairline rows, each with a chevron in a small ring. The first, "When is the gym quiet?", is open on load and answers with a heatmap in a framed figure: seven days by twelve hours, every cell the foreground colour at one of five strengths, a legend from Quiet to Packed and a line worked out from the same numbers, such as "Quietest: weekdays 1 to 3 pm". The grid is drawn by hand, in one colour, so it reads in any theme, and it scrolls inside its own frame on a phone. It's built from Accordion and Guides, with CSS transitions for the entrance and your theme's tokens for every colour. For gyms, pools, studios and coworking spaces whose members ask when to come.

FAQ

How do I put in my own busy-ness figures?

Edit LEVELS at the top of the file: one array of twelve numbers per day, from 0 (quiet) to 4 (packed), starting at FIRST_HOUR (8, so 8 am). The summary line is worked out from those arrays: the quietest and busiest two-hour windows across the weekdays and the peak across the weekend, written as "1 to 3 pm". Change a number and the line follows, in the figure and in its text alternative.

Is it a chart library?

No. It's a grid of spans: each cell is the theme's foreground colour at 20, 40, 60 or 85 percent, or the muted colour for a quiet hour, so it works in every preset and in dark mode with no palette to tune. The catalog's Heatmap is a different thing, a drifting thermal-camera background, and isn't used here.

What do screen readers and keyboards get?

The grid is one image whose text alternative is the summary: the quietest and busiest windows and the weekend peak, not eighty-four cells. The same sentence is visible under the figure. On a phone the grid scrolls sideways, so its frame is a named region you can focus and scroll with the arrow keys. Each question is a button inside its own h3.

Are the closed answers in the page's markup?

Yes. The Accordion takes hiddenUntilFound, so every closed answer stays in the markup as hidden="until-found", and the browser's find in page opens the answer that holds a match. The heatmap sits in the first answer, so it's in the markup too, whether or not it's open.

Can I move between questions with the keyboard?

Tab moves from question to question; Enter or Space opens one. Tab moves from question to question.

How does it fit on a phone?

The header and the rows stack as they are; the heatmap keeps a minimum width of 32 rem inside its frame, which scrolls sideways, and the legend moves under the summary line. Nothing scrolls the page sideways at 320 pixels. Under right-to-left languages the grid stays in reading order for time, with the hours running the same way as the clock.

  • Pro

    Diagram FAQ

    Code and media

    A centred identity-service FAQ whose first answer carries a sequence diagram with three lifelines and four numbered arrows, driven by a list of steps you can hover, focus or press.

  • Pro

    Stats FAQ

    Proof and freshness

    An FAQ for a support tool that opens on a band of four support figures on shared hairlines, then seven questions in an accordion.

  • Pro

    Accordion FAQ

    Accordion lists

    A side-header FAQ for a web analytics tool: the title, one sentence and a contact prompt beside seven questions in an accordion, behind a split divider.

  • Pro

    Reading Progress FAQ

    Reading and sharing

    A FAQ for a safety-training platform with a reading tracker: a ring that fills as questions are opened, a check on each row you've read, and a Shine Button once all eight are read.

  • Pro

    Categorized FAQ

    Topics and filters

    A topic-tabbed FAQ for a bookkeeping app: a compact header, a band of line tabs with a count on each, and one accordion per topic.

  • Pro

    Compact FAQ

    Accordion lists

    A dense FAQ for ski-lift passes: ten tight accordion rows with small type and one-sentence answers in a narrow framed list, a chevron at the start of each row.