Care Plan Accordion List
Complete a collapsible content list for a care-plan scenario: includes real content, actionable controls, clear state feedback, and responsive layouts across sizes.
With JavaScript enabled, you can edit, run, and save this example. The fixed source is as follows:
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Care Plan Accordion List</title>
<style>
:root { --ink:#252525; --paper:#f7f2e8; --accent:#247ba0; --secondary:#f4b942; --line:color-mix(in srgb, var(--ink) 18%, transparent); --shadow:0 24px 60px color-mix(in srgb, var(--ink) 16%, transparent); color-scheme:light; }
* { box-sizing:border-box; }
html { min-width:320px; background:var(--paper); }
body { min-height:100vh; margin:0; overflow-x:hidden; color:var(--ink); font-family:"Hiragino Maru Gothic ProN","PingFang SC",sans-serif; background:radial-gradient(circle at 15% 10%,color-mix(in srgb,var(--secondary) 35%,transparent) 0 9%,transparent 10%),radial-gradient(circle at 90% 75%,color-mix(in srgb,var(--accent) 18%,transparent) 0 12%,transparent 13%),var(--paper); }
button,input,select,textarea { color:inherit; font:inherit; }
button,[role="button"],input,select,textarea { accent-color:var(--accent); }
button { cursor:pointer; }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
[hidden] { display:none !important; }
@media (max-width:700px) { .mast h1 { line-height:1.08 !important; letter-spacing:-.035em !important; overflow-wrap:anywhere; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
.page{width:min(1140px,calc(100% - 28px));margin:auto;padding:54px 0}.mast{display:flex;justify-content:space-between;align-items:center;gap:24px;margin:0 12px 28px}.mast h1{font-family:"Hiragino Maru Gothic ProN","PingFang SC",sans-serif;font-weight:900;font-size:clamp(38px,8vw,82px);letter-spacing:-.035em;margin:0;line-height:.98}.eyebrow{display:inline-flex;padding:7px 12px;border-radius:999px;color:var(--paper);background:var(--accent);font-weight:900}.intro{max-width:620px;line-height:1.65}.scenario{padding:12px 18px;border-radius:999px;background:var(--secondary);box-shadow:0 7px 0 color-mix(in srgb,var(--ink) 18%,transparent);font-weight:900}.demo{border-radius:46px 18px 46px 18px;box-shadow:0 18px 0 color-mix(in srgb,var(--secondary) 45%,transparent);position:relative;min-height:390px;overflow:hidden;padding:clamp(22px,5vw,54px);background:color-mix(in srgb,var(--paper) 90%,#fff)}@media(max-width:700px){.mast{display:grid}.page{width:calc(100% - 16px);padding:18px 0}.demo{padding:17px}}
.panel{padding:24px;border-block:1px solid var(--ink);background:transparent}.stack{display:grid;gap:22px}.row{display:flex;flex-wrap:wrap;gap:16px}.action{padding:8px 0;border:0;border-bottom:1px solid currentColor;background:transparent;letter-spacing:.08em}.action.primary,.action.is-active{color:var(--accent);border-bottom-width:4px}.status{min-height:28px;margin-top:20px;font-style:italic}.metric{font-family:Didot,serif;font-size:clamp(38px,8vw,76px)}.muted{max-width:54ch;line-height:1.8}.meter{position:relative;height:3px;background:var(--line)}.meter>i{position:absolute;inset:0 auto 0 0;background:var(--accent)}.chip{padding-bottom:3px;border-bottom:1px solid var(--ink);font-size:13px}
.composition-split{display:grid;grid-template-columns:150px minmax(0,1fr);gap:18px;align-items:start}.split-note{position:sticky;top:20px;display:grid;gap:14px;padding:18px 12px;border-block:3px double var(--accent);font-size:13px;line-height:1.65}.split-note b{font:900 12px/1 ui-monospace,monospace;letter-spacing:.12em}.split-note span{writing-mode:vertical-rl;min-height:120px;color:color-mix(in srgb,var(--ink) 60%,transparent)}.composition-split .demo{min-width:0}@media(max-width:900px){.composition-split{grid-template-columns:1fr}.split-note{position:static;grid-template-columns:auto 1fr}.split-note span{writing-mode:horizontal-tb;min-height:0}}
.accordion-studio{display:grid;gap:18px;max-width:960px;margin:auto}.accordion-studio header{display:flex;justify-content:space-between;gap:18px;align-items:end}.accordion-studio h2{margin:.3em 0}.accordion-layout{display:grid;grid-template-columns:minmax(0,1.15fr) 250px;gap:14px}.accordion-stack{display:grid;gap:10px}.accordion-stack article{overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--paper)}.accordion-stack article>button{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;width:100%;padding:16px;border:0;background:transparent;text-align:left}.accordion-stack article>button span{display:grid;gap:5px}.accordion-stack article>button[aria-expanded="true"] i{transform:rotate(45deg)}.accordion-stack article>div{display:grid;gap:10px;padding:0 16px 16px;border-top:1px solid var(--line)}.accordion-stack article ul{display:grid;gap:7px;padding-left:18px;margin:0}.accordion-inspector{display:grid;align-content:start;gap:10px;padding:18px;border-left:5px solid var(--accent);background:color-mix(in srgb,var(--secondary) 10%,transparent)}.accordion-inspector strong{font-size:28px}.accordion-inspector ol{display:grid;gap:8px;padding-left:18px;margin:0}@media(max-width:720px){.accordion-studio header{align-items:stretch;flex-direction:column}.accordion-layout{grid-template-columns:1fr}}.workflow-guide{display:grid;grid-template-columns:190px minmax(0,1fr);grid-template-areas:"rail core" "rail evidence";gap:14px 18px}.guide-rail{grid-area:rail;display:grid;align-content:start;gap:15px;padding:18px;border-right:1px solid var(--line)}.guide-rail ol{display:grid;gap:8px;padding:0;margin:0;list-style:none}.guide-rail li{display:grid;grid-template-columns:30px 1fr;gap:8px;align-items:center;padding:9px;opacity:.5}.guide-rail li[aria-current="step"]{opacity:1;color:var(--paper);background:var(--ink)}.guide-rail li.is-complete{opacity:1;color:var(--accent)}.guide-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}.guide-actions .action{padding-inline:8px}#workflowGuideProgress{height:6px;background:var(--line)}#workflowGuideProgress i{display:block;width:0;height:100%;background:var(--accent)}.guide-core{grid-area:core;min-width:0;padding:16px;border:1px solid var(--line)}.guide-core>p{margin:0 0 14px;padding:10px;border-left:4px solid var(--accent);background:color-mix(in srgb,var(--secondary) 12%,transparent)}.guide-core[data-guide-step="1"]{border-radius:28px}.guide-core[data-guide-step="2"]{box-shadow:inset 0 0 0 4px color-mix(in srgb,var(--accent) 35%,transparent)}.guide-evidence{grid-area:evidence;display:grid;grid-template-columns:1fr 1fr auto;gap:12px;align-items:start}.guide-evidence details,.guide-evidence form{padding:12px;border:1px solid var(--line)}.guide-evidence label{display:grid;gap:7px}.guide-evidence textarea{width:100%;padding:9px;border:1px solid var(--line);background:var(--paper)}@media(max-width:900px){.workflow-guide{grid-template-columns:1fr;grid-template-areas:"core" "rail" "evidence"}.guide-rail{border-right:0;border-bottom:1px solid var(--line)}.guide-rail ol{grid-template-columns:repeat(3,1fr)}.guide-evidence{grid-template-columns:1fr}}
</style>
</head>
<body data-aesthetic="playful" data-composition="split-note">
<main class="page">
<header class="mast"><div><span class="eyebrow">playful / collapsible content list / INTERMEDIATE</span><h1>Care Plan Accordion List</h1><p class="intro">Complete a collapsible content list for a care-plan scenario: includes real content, actionable controls, clear state feedback, and responsive layouts across sizes.</p></div><span class="scenario">Care Plan</span></header>
<div class="composition-split"><aside class="split-note"><b>CASE 02</b><span>Understand the semantic structure, responsive layout, keyboard interaction, and state synchronization of accordion lists.</span></aside><section class="demo" aria-label="Interactive area for collapsible care plan content list"><div class="workflow-guide"><nav class="guide-rail" aria-label="Care Plan Guide"><span class="eyebrow">Care Plan GUIDE</span><ol><li data-workflow-guide-step="0" aria-current="step"><b>1</b><span>Care Plan Collection List</span></li><li data-workflow-guide-step="1"><b>2</b><span>Care plan sorting groups</span></li><li data-workflow-guide-step="2"><b>3</b><span>Care plan completed and published</span></li></ol><div class="guide-actions"><button id="workflowGuideBack" class="action" type="button" disabled>Previous</button><button id="workflowGuideNext" class="action primary" type="button">Complete this step</button></div><div id="workflowGuideProgress" role="progressbar" aria-label="Care Plan Completion" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><i></i></div></nav><section id="workflowCore" class="workflow-core guide-core" data-guide-step="0" aria-describedby="workflowGuideInstruction"><p id="workflowGuideInstruction">Please complete the relevant operations for “Care Plan Collection List” in the main example.</p><!-- 11DZ_CORE_START:cards-lists-content-accordion-list --><section class="accordion-studio"><header><div><span class="eyebrow">ACCORDION LIST</span><h2>Care Plan Care Checklist</h2><p>Each module can be expanded independently, and the current focus is shown synchronously on the right.</p></div><output id="accordionOpenCount">1 items expanded</output></header><div class="accordion-layout"><div class="accordion-stack"><article><button id="accordionButton0" type="button" data-accordion-card="0" aria-expanded="true" aria-controls="accordionPanel0" data-core-bridge="cards-lists-content-accordion-list"><span><b>Care Plan Progress</b><small>Execution Steps</small></span><i aria-hidden="true">+</i></button><div id="accordionPanel0" role="region" aria-labelledby="accordionButton0"><p>A detailed explanation of the care plan progress will stay here and remain readable within the current page.</p><ul><li>Check local records</li><li>Add key notes</li><li>Prepare the next step</li></ul></div></article><article><button id="accordionButton1" type="button" data-accordion-card="1" aria-expanded="false" aria-controls="accordionPanel1"><span><b>Care plan reminder</b><small>Additional reminder</small></span><i aria-hidden="true">+</i></button><div id="accordionPanel1" role="region" aria-labelledby="accordionButton1" hidden><p>Detailed notes for care plan reminders will stay here and remain readable on the current page.</p><ul><li>Check local records</li><li>Add key notes</li><li>Prepare the next step</li></ul></div></article><article><button id="accordionButton2" type="button" data-accordion-card="2" aria-expanded="false" aria-controls="accordionPanel2"><span><b>Care Plan Collection</b><small>Execution Steps</small></span><i aria-hidden="true">+</i></button><div id="accordionPanel2" role="region" aria-labelledby="accordionButton2" hidden><p>Detailed notes for the care plan collection will stay here and remain readable on the current page.</p><ul><li>Check local records</li><li>Add key notes</li><li>Prepare the next step</li></ul></div></article><article><button id="accordionButton3" type="button" data-accordion-card="3" aria-expanded="false" aria-controls="accordionPanel3"><span><b>Care Plan Overview</b><small>Additional reminder</small></span><i aria-hidden="true">+</i></button><div id="accordionPanel3" role="region" aria-labelledby="accordionButton3" hidden><p>Detailed information about the care plan overview will remain here and stay readable within the current page.</p><ul><li>Check local records</li><li>Add key notes</li><li>Prepare the next step</li></ul></div></article><article><button id="accordionButton4" type="button" data-accordion-card="4" aria-expanded="false" aria-controls="accordionPanel4"><span><b>Care Plan</b><small>Execution Steps</small></span><i aria-hidden="true">+</i></button><div id="accordionPanel4" role="region" aria-labelledby="accordionButton4" hidden><p>The detailed notes for the care plan will stay here and remain readable on the current page.</p><ul><li>Check local records</li><li>Add key notes</li><li>Prepare the next step</li></ul></div></article></div><aside class="accordion-inspector"><strong id="accordionCurrent">Care Plan Progress</strong><p id="accordionCurrentCopy">A summary of the currently focused module will be shown here.</p><ol id="accordionVisible"><li>Care Plan Progress</li></ol></aside></div></section><!-- 11DZ_CORE_END --></section><aside class="guide-evidence"><details id="workflowGuideDetails"><summary>View acceptance requirements</summary><ul><li>Care plan collection checklist requires one visible state change</li><li>Care plan sorting and grouping requires a visible state change</li><li>A visible state change is needed to publish the care plan</li></ul></details><form id="workflowGuideEvidenceForm"><label>This step evidence<textarea id="workflowGuideEvidence" rows="3" placeholder="Record the observed state"></textarea></label><input class="action" type="submit" value="Save evidence"></form><output id="workflowGuideSummary">0 / 3 Steps Complete</output></aside></div><p id="status" class="status" role="status" aria-live="polite"></p></section></div>
</main>
<script>
'use strict';
const statusOutput = document.querySelector('#status');
const announce = message => { statusOutput.textContent = message; };
/* 11DZ_CORE_SCRIPT_START:cards-lists-content-accordion-list */
const accordionCards=[...document.querySelectorAll('[data-accordion-card]')];function syncAccordion(){const openCards=accordionCards.filter(button=>button.getAttribute('aria-expanded')==='true');document.querySelector('#accordionOpenCount').textContent='Expanded '+openCards.length+' Item';const current=openCards.at(-1)||accordionCards[0];document.querySelector('#accordionCurrent').textContent=current.querySelector('b').textContent;document.querySelector('#accordionCurrentCopy').textContent=current.querySelector('small').textContent+'Will continue expanding in the local page.';document.querySelector('#accordionVisible').replaceChildren(...(openCards.length?openCards:[accordionCards[0]]).map(button=>{const item=document.createElement('li');item.textContent=button.querySelector('b').textContent;return item;}));}accordionCards.forEach(button=>button.addEventListener('click',()=>{const open=button.getAttribute('aria-expanded')!=='true';button.setAttribute('aria-expanded',String(open));document.querySelector('#'+button.getAttribute('aria-controls')).hidden=!open;syncAccordion();announce(button.querySelector('b').textContent+(open?' Expanded':' Collapsed'));}));syncAccordion();
/* 11DZ_CORE_SCRIPT_END */
const workflowBridgeSpec={"name":"cards-lists-content-accordion-list","selector":"[data-core-bridge=\"cards-lists-content-accordion-list\"]","mode":"click","key":"Enter"};const workflowBridgeCore=document.querySelector('#workflowCore');const workflowBridgeControl=workflowBridgeCore.querySelector(workflowBridgeSpec.selector);if(!workflowBridgeControl)throw new Error('Missing core bridge: '+workflowBridgeSpec.name);const workflowBridgeControlledId=workflowBridgeControl.getAttribute('aria-controls');const workflowBridgeControlled=workflowBridgeControlledId?document.getElementById(workflowBridgeControlledId):null;workflowBridgeCore.dataset.workflowBridge=workflowBridgeSpec.name;workflowBridgeCore.dataset.workflowVersion='0';function workflowBridgeSerialize(){const visualNode=workflowBridgeCore.firstElementChild||workflowBridgeCore;const visual=getComputedStyle(visualNode);const outputs=[...workflowBridgeCore.querySelectorAll('output,[role="status"],[aria-live],meter,progress')].map(node=>node.textContent.trim()+'|'+node.getAttribute('aria-valuenow')+'|'+node.getAttribute('value'));const canvas=[...workflowBridgeCore.querySelectorAll('canvas')].map(node=>{try{return node.toDataURL().slice(-160);}catch{return 'canvas-unavailable';}});return JSON.stringify({html:workflowBridgeCore.innerHTML,status:statusOutput.textContent,outputs,canvas,visual:[visual.display,visual.visibility,visual.opacity,visual.transform,visual.filter,visual.backgroundColor,visual.width,visual.height],scroll:workflowBridgeSpec.mode==='scroll'?workflowBridgeControl.scrollTop:null});}let workflowBridgeLastEffect=workflowBridgeSerialize();function workflowBridgeSummary(){const label=(workflowBridgeControl.getAttribute('aria-label')||workflowBridgeControl.textContent||workflowBridgeControl.value||workflowBridgeSpec.name).trim().replace(/\s+/g,' ').slice(0,72);return label+' · Core Version '+workflowBridgeCore.dataset.workflowVersion;}function workflowBridgeCommit(){const effect=workflowBridgeSerialize();if(effect===workflowBridgeLastEffect)return {changed:false,summary:workflowBridgeSummary()};workflowBridgeLastEffect=effect;workflowBridgeCore.dataset.workflowVersion=String(Number(workflowBridgeCore.dataset.workflowVersion||0)+1);return {changed:true,summary:workflowBridgeSummary()};}function workflowBridgeScheduleCommit(){queueMicrotask(workflowBridgeCommit);setTimeout(workflowBridgeCommit,0);}workflowBridgeControl.addEventListener("click",workflowBridgeScheduleCommit);const workflowBridgeStateTargets=new Set(workflowBridgeCore.querySelectorAll('dialog'));if(workflowBridgeControlled&&workflowBridgeCore.contains(workflowBridgeControlled))workflowBridgeStateTargets.add(workflowBridgeControlled);workflowBridgeStateTargets.forEach(target=>['close','cancel','toggle'].forEach(eventName=>target.addEventListener(eventName,workflowBridgeScheduleCommit)));function workflowBridgeActivate(){workflowBridgeControl.focus();workflowBridgeControl.click();const result=workflowBridgeCommit();setTimeout(workflowBridgeCommit,0);return result;}function workflowBridgeReset(){workflowBridgeCore.dataset.workflowVersion='0';workflowBridgeLastEffect=workflowBridgeSerialize();}
const workflowGuideCore=document.querySelector('#workflowCore');const workflowGuideStages=["Care Plan Collection List","Care plan sorting groups","Care plan completed and published"];const workflowGuideState={step:0,completed:new Set(),evidence:new Map(),consumedVersion:0};function workflowGuideDrive(){const step=workflowGuideState.step;workflowGuideCore.dataset.guideStep=String(step);document.querySelector('#workflowGuideInstruction').textContent='Please complete the main example ‘'+workflowGuideStages[step]+'Related actions.”';document.querySelectorAll('[data-workflow-guide-step]').forEach((item,index)=>{item.classList.toggle('is-complete',workflowGuideState.completed.has(index));if(index===step)item.setAttribute('aria-current','step');else item.removeAttribute('aria-current');});document.querySelector('#workflowGuideBack').disabled=step===0;document.querySelector('#workflowGuideNext').textContent=step===workflowGuideStages.length-1?'Save Arrangement':'Complete this step';const percent=Math.round(workflowGuideState.completed.size/workflowGuideStages.length*100);const progress=document.querySelector('#workflowGuideProgress');progress.setAttribute('aria-valuenow',String(percent));progress.querySelector('i').style.width=percent+'%';document.querySelector('#workflowGuideSummary').textContent=workflowGuideState.completed.size+' / '+workflowGuideStages.length+' Step complete · '+workflowBridgeSummary();announce('Care Plan current step:'+workflowGuideStages[step]);}function workflowGuideAdvance(direction){if(direction>0){const bridge=workflowBridgeActivate();const version=Number(workflowGuideCore.dataset.workflowVersion||0);if(version<=workflowGuideState.consumedVersion){announce('Please complete the visible state change in the main example first');return;}workflowGuideState.consumedVersion=version;workflowGuideState.completed.add(workflowGuideState.step);announce('Main case changes recorded · '+bridge.summary);}workflowGuideState.step=Math.max(0,Math.min(workflowGuideStages.length-1,workflowGuideState.step+direction));workflowGuideDrive();}document.querySelector('#workflowGuideBack').addEventListener('click',()=>workflowGuideAdvance(-1));document.querySelector('#workflowGuideNext').addEventListener('click',()=>workflowGuideAdvance(1));document.querySelector('#workflowGuideEvidenceForm').addEventListener('submit',event=>{event.preventDefault();const version=Number(workflowGuideCore.dataset.workflowVersion||0);if(version<=workflowGuideState.consumedVersion){announce('Evidence not saved: the main example has no new changes yet');return;}const text=document.querySelector('#workflowGuideEvidence').value.trim();workflowGuideState.evidence.set(workflowGuideState.step,text||'Visible status check completed');workflowGuideState.completed.add(workflowGuideState.step);workflowGuideState.consumedVersion=version;workflowGuideDrive();announce('Evidence for this step has been saved · '+workflowBridgeSummary());});document.querySelector('#workflowGuideDetails').addEventListener('toggle',event=>announce(event.currentTarget.open?'Acceptance requirements expanded':'Acceptance requirements collapsed'));workflowGuideDrive();
workflowBridgeReset();
</script>
</body>
</html>