Recap: Interactive Panels
Part of the Responsive UI Patterns section of Coddy's Tailwind CSS journey. Lesson 40 of 55.
Challenge
HardBuild a preference panel with native radio cards and contextual help. Each unselected radio card is white and normal-weight; its checked card is #dbeafe and bold. In the separate reference field group, hide the help at rest and show it while any descendant has focus, then hide it when focus leaves. Preserve the radio group, labels and field input.
Preserve the supplied content, semantic elements and IDs. Edit the requested utility classes. Press Run preview after edits, then Check/Run code to grade the result. Supplied JavaScript is read-only.
Try it yourself
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Interface workshop</title><link rel="stylesheet" href="./styles.css"></head><body>
<div><label id="digitalCard" class="block p-3 bg-white font-normal"><input id="digital" type="radio" name="format"> Digital guide</label><label id="printedCard" class="block p-3 bg-white font-normal"><input id="printed" type="radio" name="format"> Printed guide</label></div><button id="before">Reference</button><div class="group p-3"><label for="reference">Reference</label><input id="reference" class="border"><p id="help" class="hidden">Use your booking reference.</p></div><button id="after">Done</button>
</body></html>
All lessons in Responsive UI Patterns
1Page Shells
Growing Page ShellsFlexible Content RailsBounded Scroll RegionsFull-Bleed RegionsRecap: Page Shells4Form Layouts
Responsive Field GroupsFocused Field GroupsSelectable Form OptionsNative Validation CuesRecap: Form Layouts2Navigation Patterns
Wrapping NavigationCurrent Page CuesNative Menu DisclosuresKeyboard Skip LinksRecap: Navigation5Data Tables
Scrollable Data TablesPredictable Table ColumnsRow State PresentationSticky Table HeadersRecap: Data Tables8Interactive Panels
Expanded Control CuesChoice Card StatesFocus-Aware Help PanelsContent-Aware Empty StatesRecap: Interactive Panels11Project: Event Portal
Portal ShellSession Browser