Capstone: responsive dashboard panel
The capstone brings together tokens, Grid, Flexbox, responsive rules, component states, and accessibility checks.
✓ What you will learn in this topic
- Explain the key idea: A capstone combines layout and tokens with real interaction and accessibility checks.
- Apply the concept: The panel cards flow into available columns, while action controls wrap and maintain consistent spacing.
- Avoid this common mistake:
Concept explanation
Start with semantic regions and a reading order that works without styling. Use Grid for the panel layout, Flexbox for action groups, and a container query only if the panelâs own allocation should change its composition. Keep text flexible and controls visible at narrow sizes.
Test keyboard focus, reduced motion, contrast, translated or long labels, and intermediate widths. Review the stylesheet for duplicate declarations before considering the component complete.
Syntax
A CSS rule has a selector followed by declarations. Each declaration is a property and a value; the braces group the declarations that apply to matching elements.
.demo {
display: grid;
gap: 1rem;
min-width: 0;
}Example 1: a small page element
Use this HTML as the target and place the CSS in a stylesheet linked to the page, or inside a <style> element while experimenting.
<main class="demo card-grid course-grid dashboard-panel course-card-list dashboard-grid card-layout"><h2>Learning card</h2><p>Clear styles make this information easier to scan.</p><nav class="site-nav"><a href="/learn">Courses</a></nav><label class="form-field"><span>Email</span><input type="email" aria-invalid="true"></label><article class="card course-card dashboard-card theme-dark"><span class="badge status">New</span><div class="course-card__image"></div><h2 class="course-card__title card__title">Course update</h2><p class="status">New lessons are available this week.</p><a href="/learn" aria-current="page">Read the details</a><div class="actions course-card__actions dashboard-panel__actions"><button type="button">View lessons</button><button type="button" disabled>Unavailable</button></div></article></main>.demo {
display: grid;
gap: 1rem;
min-width: 0;
}Expected result: The panel cards flow into available columns, while action controls wrap and maintain consistent spacing.
Example 2: a practical interface card
The same idea can style a reusable card on a course page. The class selector keeps the rule attached to this component rather than changing every element of that type.
<section class="demo card-grid course-grid dashboard-panel course-card-list dashboard-grid card-layout"><h2>Learning card</h2><p>Clear styles make this information easier to scan.</p><nav class="site-nav"><a href="/learn">Courses</a></nav><label class="form-field"><span>Email</span><input type="email" aria-invalid="true"></label><article class="card course-card dashboard-card theme-dark"><span class="badge status">New</span><div class="course-card__image"></div><h2 class="course-card__title card__title">Course update</h2><p class="status">New lessons are available this week.</p><a href="/learn" aria-current="page">Read the details</a><div class="actions course-card__actions dashboard-panel__actions"><button type="button">View lessons</button><button type="button" disabled>Unavailable</button></div></article></section>.dashboard-panel {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
gap: 1rem;
padding: clamp(1rem, 3vw, 2rem);
}
.dashboard-panel__actions {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
}Expected result: The course update reads as a distinct interface card, and its content follows the spacing, color, and layout choices in the rule.
Common mistake
Building a complex interface with visual CSS tricks while ignoring semantics, source order, and keyboard interaction.
Best practice
Define component states and responsive behavior before polishing; keep DOM order meaningful and CSS responsibilities clear.
Practice exercise
Design a responsive dashboard panel with a summary, status indicator, data list, and actions that remain usable on mobile and desktop. Apply it to the example above and inspect the result at a narrow and a wide viewport.
Section summary
- A capstone combines layout and tokens with real interaction and accessibility checks.
- Define component states and responsive behavior before polishing; keep DOM order meaningful and CSS responsibilities clear.
Knowledge check
Which is a useful final review for a dashboard component?
Reveal the explanation
A visual match at one size does not verify responsiveness, accessibility, or content resilience.
Finish the module lessons, then take the server-scored module quiz to check your understanding.
Practical example
css.demo {
display: grid;
gap: 1rem;
min-width: 0;
}
Expected result:
The panel cards flow into available columns, while action controls wrap and maintain consistent spacing.
Hands-on practice task
Design a responsive dashboard panel with a summary, status indicator, data list, and actions that remain usable on mobile and desktop.
In this section
Other lessons in Advanced UI Patterns and Projects
Broaden your knowledge
Related learning topics
HTML
Learn to structure accessible, meaningful web pages with a complete HTML course from first document to professional application patterns.
JavaScript
Build strong JavaScript foundations with browser examples, focused practice, beginner projects, and module quizzes.