{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"reading-list","type":"registry:component","title":"Reading List","description":"Keep a local queue of books and articles with three reading states.","author":"Notion Arena","categories":["docs"],"tags":["widget","free","reading list","books","articles","library","learning"],"meta":{"kind":"widget","tier":"free","version":"1.0.0","updatedAt":"2026-10-11","notionPlan":"Free","emoji":"📚","delivery":["embed","html-block","download"],"capabilities":{"interactive":true,"offlineSafe":true,"persistsLocally":true,"writesToNotion":false,"needsNetwork":false},"embedUrl":"https://notionarena.vercel.app/embed/reading-list","fileUrl":"https://notionarena.vercel.app/widgets/reading-list.html","downloadUrl":"https://notionarena.vercel.app/api/widget/reading-list","height":360,"minHeight":250,"maxHeight":520,"params":[{"key":"label","label":"List title","type":"text","default":"Reading list"},{"key":"accent","label":"Accent","type":"color","default":"#6940a5"},{"key":"theme","label":"Theme","type":"select","default":"auto","options":[{"value":"auto","label":"Match Notion"},{"value":"light","label":"Light"},{"value":"dark","label":"Dark"}]}]},"files":[{"path":"widgets/reading-list.html","type":"registry:file","target":"notion/widgets/reading-list.html","content":"<!doctype html>\n<html lang=\"en\" data-theme=\"auto\">\n<head>\n<meta charset=\"utf-8\" /><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n<title>Reading List</title>\n<style>\n:root{--bg:#fff;--fg:#37352f;--muted:#787774;--surface:#f7f7f5;--border:#e9e9e7;--accent:#6940a5;--accent-ink:#fff;--accent-text:var(--accent);--danger:#c24136}\nhtml[data-theme=\"dark\"]{--bg:#191919;--fg:#e6e6e4;--muted:#9b9a97;--surface:#252525;--border:#343434;--danger:#ff7369}\n@media(prefers-color-scheme:dark){html[data-theme=\"auto\"]{--bg:#191919;--fg:#e6e6e4;--muted:#9b9a97;--surface:#252525;--border:#343434;--danger:#ff7369}}\n*{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}html,body{margin:0;height:100%}body{background:var(--bg);color:var(--fg);font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,\"Segoe UI\",Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;overflow:hidden}.wrap{height:100%;min-height:250px;display:flex;flex-direction:column;gap:8px;padding:13px;overflow:auto}.head{display:flex;align-items:center;justify-content:space-between;gap:8px}.kicker{font-size:9px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);font-weight:650}.title{font-size:14px;font-weight:650;margin-top:2px}.summary{font-size:9px;color:var(--muted);text-align:right}.summary b{display:block;color:var(--accent-text);font-size:12px}.form{display:grid;grid-template-columns:minmax(0,1fr) 108px 100px auto;gap:5px}.form input,.form select{min-width:0;height:30px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--fg);padding:4px 6px;font:inherit;font-size:9.5px}.form input:focus-visible,.form select:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.form button{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--accent-ink);font:inherit;font-size:9px;padding:4px 8px;cursor:pointer}.form button:focus-visible,.remove:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.list{display:flex;min-height:65px;flex:1;flex-direction:column;gap:4px;overflow:auto}.row{display:grid;grid-template-columns:minmax(0,1fr) 100px 24px;align-items:center;gap:4px 7px;padding:6px 7px;border:1px solid var(--border);border-radius:7px;background:var(--surface)}.book{min-width:0;overflow-wrap:anywhere;font-size:10px;font-weight:600}.author{color:var(--muted);font-size:8.5px}.status-select{width:100%;height:25px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--fg);font:inherit;font-size:8.5px;padding:3px}.status-select:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.remove{grid-column:3;grid-row:1/3;width:23px;height:23px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--muted);cursor:pointer}.remove:hover{border-color:var(--danger);color:var(--danger)}.foot{display:flex;align-items:center;justify-content:space-between;gap:8px}.status,.note{font-size:9px;color:var(--muted);line-height:1.35}.clear{min-height:25px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--fg);font:inherit;font-size:9px;padding:3px 7px;cursor:pointer}.empty{text-align:center;padding:12px;color:var(--muted);font-size:10px}@media(max-width:350px){.wrap{padding:10px}.form{grid-template-columns:minmax(0,1fr) auto}.form input:first-of-type{grid-column:1/3}.form button{grid-column:1/3}.row{grid-template-columns:minmax(0,1fr) 86px 22px;gap:4px}.status-select{font-size:8px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}\n</style>\n</head>\n<body><main class=\"wrap\">\n  <header class=\"head\"><div><div class=\"kicker\">Personal reading queue</div><div class=\"title\" id=\"title\">Reading list</div></div><div class=\"summary\"><b id=\"counts\">0 to read</b><span id=\"finished\">0 finished</span></div></header>\n  <form class=\"form\" id=\"form\"><label class=\"sr-only\" for=\"name\">Title</label><input id=\"name\" maxlength=\"64\" placeholder=\"Book or article title\" required /><label class=\"sr-only\" for=\"author\">Author</label><input id=\"author\" maxlength=\"48\" placeholder=\"Author (optional)\" /><label class=\"sr-only\" for=\"statusSelect\">Reading status</label><select id=\"statusSelect\"><option>To read</option><option>Reading</option><option>Finished</option></select><button type=\"submit\">Add</button></form>\n  <section class=\"list\" id=\"list\" aria-label=\"Reading queue\"></section>\n  <footer class=\"foot\"><span class=\"status\" id=\"status\" aria-live=\"polite\">List saves only in this browser. No book lookup.</span><button class=\"clear\" id=\"clear\" type=\"button\">Clear finished</button></footer>\n  <div class=\"note\">A private reading queue. It does not fetch book details or replace a shared library.</div>\n</main>\n<script>\n(function(){\n  var cfgEl=document.getElementById('bk-config'),base={};try{base=cfgEl?JSON.parse(cfgEl.textContent||'{}'):{};}catch(e){}\n  var q=new URLSearchParams(location.search),c={};for(var k in base)c[k]=base[k];q.forEach(function(v,k){c[k]=v;});\n  function safeColor(v,d){return /^#[0-9a-f]{6}$/i.test(String(v||''))?String(v):d;}function rgb(hex){var s=String(hex).slice(1);return[0,2,4].map(function(i){return parseInt(s.slice(i,i+2),16);});}function lum(a){return a.map(function(v){v/=255;return v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4);}).reduce(function(s,v,i){return s+v*[.2126,.7152,.0722][i];},0);}function contrast(a,b){var x=lum(a),y=lum(b);return(Math.max(x,y)+.05)/(Math.min(x,y)+.05);}function accentInk(hex){var a=rgb(hex);return contrast(a,[255,255,255])>=contrast(a,[0,0,0])?'#fff':'#000';}function accentText(hex){var dark=theme==='dark'||(theme==='auto'&&window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches),bg=rgb(dark?'#252525':'#f7f7f5'),a=rgb(hex),to=dark?[255,255,255]:[0,0,0];if(contrast(a,bg)>=4.5)return hex;for(var t=.02;t<=1;t+=.02){var m=a.map(function(v,i){return Math.round(v+(to[i]-v)*t);});if(contrast(m,bg)>=4.5)return'#'+m.map(function(v){return v.toString(16).padStart(2,'0');}).join('');}return dark?'#fff':'#191919';}function setAccentText(){document.documentElement.style.setProperty('--accent-text',accentText(ACCENT));}\n  var theme=['auto','light','dark'].indexOf(String(c.theme||'auto'))>-1?String(c.theme||'auto'):'auto',ACCENT=safeColor(c.accent,'#6940a5'),LABEL=String(c.label||'Reading list').slice(0,48),KEY='notion-arena.reading-list.v1',items=[];\n  document.documentElement.setAttribute('data-theme',theme);document.documentElement.style.setProperty('--accent',ACCENT);document.documentElement.style.setProperty('--accent-ink',accentInk(ACCENT));setAccentText();if(theme==='auto'&&window.matchMedia){var scheme=window.matchMedia('(prefers-color-scheme: dark)');if(scheme.addEventListener)scheme.addEventListener('change',setAccentText);else if(scheme.addListener)scheme.addListener(setAccentText);}document.getElementById('title').textContent=LABEL;document.title=LABEL;\n  try{var parsed=JSON.parse(localStorage.getItem(KEY)||'[]');if(Array.isArray(parsed))items=parsed.filter(function(x){return x&&typeof x.name==='string';}).slice(0,100);}catch(e){}\n  var list=document.getElementById('list'),status=document.getElementById('status'),statuses=['To read','Reading','Finished'];function save(message){try{localStorage.setItem(KEY,JSON.stringify(items));status.textContent=message||'List saves only in this browser. No book lookup.';}catch(e){status.textContent='Storage is unavailable in this browser session.';}}\n  function render(){list.textContent='';var todo=items.filter(function(x){return x.status!=='Finished';}).length,done=items.length-todo;document.getElementById('counts').textContent=todo+' to read';document.getElementById('finished').textContent=done+' finished';if(!items.length){var empty=document.createElement('div');empty.className='empty';empty.textContent='Add a book or article to start your queue.';list.appendChild(empty);return;}items.forEach(function(item,index){var row=document.createElement('div');row.className='row';var title=document.createElement('span');title.className='book';title.textContent=item.name;var author=document.createElement('span');author.className='author';author.textContent=item.author||'No author added';var select=document.createElement('select');select.className='status-select';select.setAttribute('aria-label','Reading status for '+item.name);statuses.forEach(function(s){var option=document.createElement('option');option.value=s;option.textContent=s;select.appendChild(option);});select.value=statuses.indexOf(item.status)>=0?item.status:'To read';select.addEventListener('change',function(){item.status=select.value;save();render();});var remove=document.createElement('button');remove.className='remove';remove.type='button';remove.textContent='×';remove.setAttribute('aria-label','Remove '+item.name);remove.addEventListener('click',function(){items.splice(index,1);save();render();});row.append(title,select,author,remove);list.appendChild(row);});}\n  document.getElementById('form').addEventListener('submit',function(e){e.preventDefault();var name=document.getElementById('name').value.trim().slice(0,64),author=document.getElementById('author').value.trim().slice(0,48),state=document.getElementById('statusSelect').value;if(!name)return;if(items.length>=100){status.textContent='Reading list limit reached.';return;}items.push({name:name,author:author,status:statuses.indexOf(state)>=0?state:'To read'});document.getElementById('name').value='';document.getElementById('author').value='';document.getElementById('statusSelect').value='To read';save();render();document.getElementById('name').focus();});document.getElementById('clear').addEventListener('click',function(){items=items.filter(function(x){return x.status!=='Finished';});save('Finished items cleared.');render();});render();\n})();\n</script>\n</body>\n</html>\n"}]}