Consent Detail Lift
Supplementary consent terms expand next to a checkbox when the form field is hovered.
Supplementary consent terms expand next to a checkbox when the form field is hovered.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<div class="tbx-1240"><label class="consent"><input type="checkbox" name="tb1240-demo"/><span class="visual" aria-hidden="true">✓</span><span class="body"><b>Send product updates</b><small>Receive updates by email</small><span class="detail">You may unsubscribe at any time. This field is optional.</span></span></label></div>
.tbx-1240{box-sizing:border-box;display:flex;align-items:center;justify-content:center;min-height:212px;width:100%;max-width:100%;padding:19px;overflow:hidden;font-family:system-ui,-apple-system,sans-serif;color:#18314a;}
.tbx-1240 * ,.tbx-1240 *::before,.tbx-1240 *::after{box-sizing:border-box}
.tbx-1240{background:#e5ecec}.tbx-1240 .consent{cursor:pointer;position:relative;display:flex;align-items:start;gap:12px;width:min(100%,315px);padding:17px 18px;background:#fff;border:1px solid #cddfe0;border-radius:9px;box-shadow:0 8px 20px #3d777615;transition:border-color .25s,box-shadow .25s}.tbx-1240 input{position:absolute;width:1px;height:1px;opacity:0}.tbx-1240 .visual{flex:0 0 23px;width:23px;height:23px;border:2px solid #98babc;border-radius:6px;display:grid;place-items:center;font-size:14px;color:transparent;transition:background .25s,color .25s,border-color .25s}.tbx-1240 .body{display:grid;gap:4px;flex:1;min-width:0}.tbx-1240 .body b{font-size:13px}.tbx-1240 .body small{font-size:10px;color:#648187}.tbx-1240 .detail{display:block;max-height:0;overflow:hidden;opacity:0;transform:translateY(-5px);transition:max-height .32s,opacity .32s,transform .32s;font-size:10px;color:#456c72;line-height:1.5}.tbx-1240 .consent:is(:hover,:focus-within){border-color:#3d8585;box-shadow:0 9px 22px #3d77762c}.tbx-1240 .consent:is(:hover,:focus-within) .detail{max-height:65px;opacity:1;transform:none}.tbx-1240 input:checked+.visual{background:#2f8080;color:white;border-color:#2f8080}.tbx-1240 input:focus-visible+.visual{outline:3px solid #cb864c;outline-offset:3px}
@media(prefers-reduced-motion:reduce){.tbx-1240 *, .tbx-1240 *::before,.tbx-1240 *::after{transition-duration:0.01ms!important;animation-duration:0.01ms!important;scroll-behavior:auto!important}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for forms and accessibility sections.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile: Ensure the interactive content remains accessible without hover on touch devices.
Browser: Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion: Check that prefers-reduced-motion is respected.