Skip to content
← Saved View
Edit Saved View
Name
Also known as (comma separated)
Brief definition
Persisted combination of filters/sort/columns.
Notes
**Enterprise Application UI:** Persistent table/filter configuration. **Common Application Patterns:** Persisted view configuration.
Tier
Core
Useful
Reference
Deleted
Controls schema (JSON array)
[ { "id": "caption", "type": "text", "label": "Caption", "default": "Customer orders" }, { "id": "accent", "type": "color", "label": "Accent", "default": "#241430", "presets": [ "#241430", "#A8E6C1", "#F5C2E0", "#BFD9F2", "#D9C8F0", "#E8A020" ] }, { "id": "view", "type": "select", "label": "Active view", "default": "All orders", "options": [ "All orders", "Shipped only", "High value" ] }, { "id": "showStar", "type": "toggle", "label": "Star the active view", "default": true }, { "id": "manageLabel", "type": "text", "label": "Manage button label", "default": "Manage views" } ]
Templates (JSON object keyed by format)
{ "html": "<div class=\"svw\" data-view=\"{{view}}\" style=\"--accent:{{accent}};\">\n <div class=\"svw__bar\">\n <div class=\"svw__pills\" role=\"group\" aria-label=\"Saved views\">\n <button type=\"button\" class=\"svw__pill svw__pill--all\">{{#if showStar}}<span class=\"svw__star\" aria-hidden=\"true\">★</span>{{/if}}All orders</button>\n <button type=\"button\" class=\"svw__pill svw__pill--shipped\">{{#if showStar}}<span class=\"svw__star\" aria-hidden=\"true\">★</span>{{/if}}Shipped only</button>\n <button type=\"button\" class=\"svw__pill svw__pill--high\">{{#if showStar}}<span class=\"svw__star\" aria-hidden=\"true\">★</span>{{/if}}High value</button>\n </div>\n <button type=\"button\" class=\"svw__manage\">{{manageLabel}}</button>\n </div>\n <div class=\"svw__scroll\">\n <table class=\"svw__table\">\n <caption>{{caption}}</caption>\n <thead><tr><th scope=\"col\">Order</th><th scope=\"col\">Customer</th><th scope=\"col\">Status</th><th scope=\"col\">Total</th></tr></thead>\n <tbody>\n <tr data-status=\"shipped\" data-tier=\"low\"><td>#1042</td><td>A. Whitfield</td><td>Shipped</td><td>£64.00</td></tr>\n <tr data-status=\"processing\" data-tier=\"high\"><td>#1041</td><td>R. Okafor</td><td>Processing</td><td>£128.50</td></tr>\n <tr data-status=\"shipped\" data-tier=\"low\"><td>#1040</td><td>M. Iqbal</td><td>Shipped</td><td>£22.00</td></tr>\n <tr data-status=\"shipped\" data-tier=\"high\"><td>#1038</td><td>L. Duarte</td><td>Shipped</td><td>£96.20</td></tr>\n </tbody>\n </table>\n </div>\n</div>\n<style>\n.svw { font: 14px system-ui, sans-serif; color: #241430; background: #FAF7F2; max-width: 480px; border: 1px solid #24143020; border-radius: 10px; overflow: hidden; }\n.svw__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #24143020; }\n.svw__pills { display: flex; gap: 6px; flex-wrap: wrap; }\n.svw__pill { border: 1px solid #24143040; background: #FAF7F2; color: #241430; padding: 5px 10px; border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }\n.svw__pill:hover { background: #24143010; }\n.svw__pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }\n.svw__star { display: none; color: #E8A020; }\n.svw[data-view=\"All orders\"] .svw__pill--all,\n.svw[data-view=\"Shipped only\"] .svw__pill--shipped,\n.svw[data-view=\"High value\"] .svw__pill--high { background: var(--accent); color: #FAF7F2; border-color: var(--accent); }\n.svw[data-view=\"All orders\"] .svw__pill--all .svw__star,\n.svw[data-view=\"Shipped only\"] .svw__pill--shipped .svw__star,\n.svw[data-view=\"High value\"] .svw__pill--high .svw__star { display: inline; }\n.svw__manage { font-size: 12px; border: 1px solid #24143040; background: #FAF7F2; border-radius: 6px; padding: 5px 10px; cursor: pointer; }\n.svw__scroll { overflow-x: auto; }\n.svw__table { border-collapse: collapse; width: 100%; }\n.svw__table caption { text-align: left; font-weight: 600; padding: 10px 14px; }\n.svw__table th, .svw__table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #24143020; white-space: nowrap; }\n.svw__table th { background: var(--accent); color: #FAF7F2; }\n.svw[data-view=\"Shipped only\"] tbody tr:not([data-status=\"shipped\"]) { display: none; }\n.svw[data-view=\"High value\"] tbody tr:not([data-tier=\"high\"]) { display: none; }\n</style>", "tailwind": "<div class=\"max-w-[480px] rounded-[10px] border border-[#24143020] font-sans text-sm text-[#241430] bg-[#FAF7F2] overflow-hidden\" data-view=\"{{view}}\" style=\"--accent:{{accent}};\">\n <div class=\"flex flex-wrap justify-between items-center gap-2 px-3.5 py-2.5 border-b border-[#24143020]\">\n <div class=\"flex gap-1.5 flex-wrap\" role=\"group\" aria-label=\"Saved views\">\n <button type=\"button\" class=\"svw__pill svw__pill--all inline-flex items-center gap-1 border border-[#24143040] bg-[#FAF7F2] text-[#241430] px-2.5 py-1 rounded-full text-xs\">{{#if showStar}}<span aria-hidden=\"true\" class=\"svw__star text-[#E8A020] hidden\">★</span>{{/if}}All orders</button>\n <button type=\"button\" class=\"svw__pill svw__pill--shipped inline-flex items-center gap-1 border border-[#24143040] bg-[#FAF7F2] text-[#241430] px-2.5 py-1 rounded-full text-xs\">{{#if showStar}}<span aria-hidden=\"true\" class=\"svw__star text-[#E8A020] hidden\">★</span>{{/if}}Shipped only</button>\n <button type=\"button\" class=\"svw__pill svw__pill--high inline-flex items-center gap-1 border border-[#24143040] bg-[#FAF7F2] text-[#241430] px-2.5 py-1 rounded-full text-xs\">{{#if showStar}}<span aria-hidden=\"true\" class=\"svw__star text-[#E8A020] hidden\">★</span>{{/if}}High value</button>\n </div>\n <button type=\"button\" class=\"text-xs border border-[#24143040] bg-[#FAF7F2] rounded-md px-2.5 py-1\">{{manageLabel}}</button>\n </div>\n <div class=\"overflow-x-auto\">\n <table class=\"border-collapse w-full\">\n <caption class=\"text-left font-semibold px-3.5 py-2.5\">{{caption}}</caption>\n <thead><tr class=\"text-[#FAF7F2]\" style=\"background:{{accent}}\">\n <th scope=\"col\" class=\"p-3.5 text-left whitespace-nowrap\">Order</th>\n <th scope=\"col\" class=\"p-3.5 text-left whitespace-nowrap\">Customer</th>\n <th scope=\"col\" class=\"p-3.5 text-left whitespace-nowrap\">Status</th>\n <th scope=\"col\" class=\"p-3.5 text-left whitespace-nowrap\">Total</th>\n </tr></thead>\n <tbody>\n <tr data-status=\"shipped\" data-tier=\"low\"><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">#1042</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">A. Whitfield</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">Shipped</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">£64.00</td></tr>\n <tr data-status=\"processing\" data-tier=\"high\"><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">#1041</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">R. Okafor</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">Processing</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">£128.50</td></tr>\n <tr data-status=\"shipped\" data-tier=\"low\"><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">#1040</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">M. Iqbal</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">Shipped</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">£22.00</td></tr>\n <tr data-status=\"shipped\" data-tier=\"high\"><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">#1038</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">L. Duarte</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">Shipped</td><td class=\"p-3.5 border-b border-[#24143020] whitespace-nowrap\">£96.20</td></tr>\n </tbody>\n </table>\n </div>\n</div>\n<style>\n[data-view=\"All orders\"] .svw__pill--all,\n[data-view=\"Shipped only\"] .svw__pill--shipped,\n[data-view=\"High value\"] .svw__pill--high { background: var(--accent); color: #FAF7F2; border-color: var(--accent); }\n[data-view=\"All orders\"] .svw__pill--all .svw__star,\n[data-view=\"Shipped only\"] .svw__pill--shipped .svw__star,\n[data-view=\"High value\"] .svw__pill--high .svw__star { display: inline; }\n[data-view=\"Shipped only\"] tbody tr:not([data-status=\"shipped\"]) { display: none; }\n[data-view=\"High value\"] tbody tr:not([data-tier=\"high\"]) { display: none; }\n</style>", "react": "function SavedView({\n caption = \"{{caption}}\",\n accent = \"{{accent}}\",\n view = \"{{view}}\",\n showStar = {{showStar}},\n manageLabel = \"{{manageLabel}}\",\n}) {\n const rows = [\n [\"#1042\", \"A. Whitfield\", \"shipped\", \"low\", \"£64.00\"],\n [\"#1041\", \"R. Okafor\", \"processing\", \"high\", \"£128.50\"],\n [\"#1040\", \"M. Iqbal\", \"shipped\", \"low\", \"£22.00\"],\n [\"#1038\", \"L. Duarte\", \"shipped\", \"high\", \"£96.20\"],\n ];\n const visible = rows.filter((r) => view === \"All orders\" || (view === \"Shipped only\" && r[2] === \"shipped\") || (view === \"High value\" && r[3] === \"high\"));\n const cell = { padding: \"10px 14px\", borderBottom: \"1px solid #24143020\", whiteSpace: \"nowrap\" };\n const pill = (key, label) => (\n <button key={key} type=\"button\" style={{\n display: \"inline-flex\", alignItems: \"center\", gap: 4,\n border: `1px solid ${view === key ? accent : \"#24143040\"}`, background: view === key ? accent : \"#FAF7F2\",\n color: view === key ? \"#FAF7F2\" : \"#241430\", padding: \"5px 10px\", borderRadius: 999, font: \"inherit\", fontSize: 12, cursor: \"pointer\",\n }}>{showStar && view === key && <span aria-hidden=\"true\" style={{ color: \"#E8A020\" }}>★</span>}{label}</button>\n );\n return (\n <div style={{ maxWidth: 480, borderRadius: 10, border: \"1px solid #24143020\", overflow: \"hidden\", font: \"14px system-ui, sans-serif\", color: \"#241430\", background: \"#FAF7F2\" }}>\n <div style={{ display: \"flex\", flexWrap: \"wrap\", justifyContent: \"space-between\", alignItems: \"center\", gap: 8, padding: \"10px 14px\", borderBottom: \"1px solid #24143020\" }}>\n <div role=\"group\" aria-label=\"Saved views\" style={{ display: \"flex\", gap: 6, flexWrap: \"wrap\" }}>\n {pill(\"All orders\", \"All orders\")}{pill(\"Shipped only\", \"Shipped only\")}{pill(\"High value\", \"High value\")}\n </div>\n <button type=\"button\" style={{ fontSize: 12, border: \"1px solid #24143040\", background: \"#FAF7F2\", borderRadius: 6, padding: \"5px 10px\", cursor: \"pointer\" }}>{manageLabel}</button>\n </div>\n <div style={{ overflowX: \"auto\" }}>\n <table style={{ borderCollapse: \"collapse\", width: \"100%\" }}>\n <caption style={{ textAlign: \"left\", fontWeight: 600, padding: \"10px 14px\" }}>{caption}</caption>\n <thead>\n <tr style={{ background: accent, color: \"#FAF7F2\" }}>\n {[\"Order\", \"Customer\", \"Status\", \"Total\"].map((h) => <th key={h} scope=\"col\" style={cell}>{h}</th>)}\n </tr>\n </thead>\n <tbody>\n {visible.map((row) => (\n <tr key={row[0]}>\n <td style={cell}>{row[0]}</td><td style={cell}>{row[1]}</td>\n <td style={cell}>{row[2][0].toUpperCase() + row[2].slice(1)}</td><td style={cell}>{row[4]}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n}" }
Save
History