Menu
CoddyTech

Recap: Interactive Panels

Part of the Responsive UI Patterns section of Coddy's Tailwind CSS journey. Lesson 40 of 55.

challenge icon

Challenge

Hard

Build 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