Skip to content
← Nested Row
Edit Nested Row
Name
Also known as (comma separated)
Brief definition
Child row displayed under a parent.
Notes
Tier
Core
Useful
Reference
Deleted
Controls schema (JSON array)
[ { "id": "caption", "type": "text", "label": "Caption", "default": "Orders with line items" }, { "id": "accent", "type": "color", "label": "Accent", "default": "#241430", "presets": [ "#241430", "#A8E6C1", "#F5C2E0", "#BFD9F2", "#D9C8F0", "#E8A020" ] }, { "id": "expanded", "type": "toggle", "label": "Open by default", "default": true }, { "id": "detailText", "type": "text", "label": "Line items", "default": "2x Wireless mouse, 1x USB-C cable" }, { "id": "indent", "type": "number", "label": "Detail indent (px)", "default": 20, "min": 12, "max": 32, "step": 4 } ]
Templates (JSON object keyed by format)
{ "html": "<div class=\"nrow\" style=\"--accent:{{accent}};\">\n <div class=\"nrow__scroll\">\n <table class=\"nrow__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><td>#1042</td><td>A. Whitfield</td><td>Shipped</td><td>£64.00</td></tr>\n <tr class=\"nrow__child\">\n <td colspan=\"4\">\n <details class=\"nrow__details\" {{#if expanded}}open{{/if}}>\n <summary>Line items for #1042</summary>\n <div class=\"nrow__body\" style=\"padding-left:{{indent}}px;\">{{detailText}}</div>\n </details>\n </td>\n </tr>\n <tr><td>#1041</td><td>R. Okafor</td><td>Processing</td><td>£128.50</td></tr>\n <tr><td>#1040</td><td>M. Iqbal</td><td>Shipped</td><td>£22.00</td></tr>\n </tbody>\n </table>\n </div>\n</div>\n<style>\n.nrow { font: 14px system-ui, sans-serif; color: #241430; background: #FAF7F2; max-width: 480px; border: 1px solid #24143020; border-radius: 10px; overflow: hidden; }\n.nrow__scroll { overflow-x: auto; }\n.nrow__table { border-collapse: collapse; width: 100%; }\n.nrow__table caption { text-align: left; font-weight: 600; padding: 10px 14px; }\n.nrow__table th, .nrow__table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #24143020; white-space: nowrap; }\n.nrow__table th { background: var(--accent); color: #FAF7F2; }\n.nrow__child td { background: #24143008; white-space: normal; }\n.nrow__details summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; }\n.nrow__details summary::-webkit-details-marker { display: none; }\n.nrow__details summary::before { content: \"\\25B8\"; display: inline-block; margin-right: 6px; }\n.nrow__details[open] summary::before { transform: rotate(90deg); }\n@media (prefers-reduced-motion: no-preference) {\n .nrow__details summary::before { transition: transform .15s; }\n}\n.nrow__details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }\n.nrow__body { padding-top: 6px; color: #241430cc; font-size: 13px; }\n</style>", "tailwind": "<div class=\"max-w-[480px] rounded-[10px] border border-[#24143020] font-sans text-sm text-[#241430] bg-[#FAF7F2] overflow-hidden\" style=\"--accent:{{accent}};\">\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><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>\n <td colspan=\"4\" class=\"bg-[#24143008] px-3.5 py-2\">\n <details class=\"nrow__details\" {{#if expanded}}open{{/if}}>\n <summary class=\"cursor-pointer font-semibold list-none\" style=\"color:{{accent}}\">Line items for #1042</summary>\n <div class=\"pt-1.5 text-[13px] text-[#241430cc]\" style=\"padding-left:{{indent}}px;\">{{detailText}}</div>\n </details>\n </td>\n </tr>\n <tr><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><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 </tbody>\n </table>\n </div>\n</div>\n<style>\n.nrow__details summary::-webkit-details-marker { display: none; }\n.nrow__details summary::before { content: \"\\25B8\"; display: inline-block; margin-right: 6px; }\n.nrow__details[open] summary::before { transform: rotate(90deg); }\n@media (prefers-reduced-motion: no-preference) {\n .nrow__details summary::before { transition: transform .15s; }\n}\n</style>", "react": "function NestedRow({\n caption = \"{{caption}}\",\n accent = \"{{accent}}\",\n expanded = {{expanded}},\n detailText = \"{{detailText}}\",\n indent = {{indent}},\n}) {\n const cell = { padding: \"10px 14px\", borderBottom: \"1px solid #24143020\", whiteSpace: \"nowrap\" };\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={{ 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 <tr>{[\"#1042\", \"A. Whitfield\", \"Shipped\", \"£64.00\"].map((c, j) => <td key={j} style={cell}>{c}</td>)}</tr>\n <tr>\n <td colSpan={4} style={{ background: \"#24143008\", padding: \"8px 14px\" }}>\n <details open={expanded}>\n <summary style={{ cursor: \"pointer\", fontWeight: 600, color: accent, listStyle: \"none\" }}>Line items for #1042</summary>\n <div style={{ paddingTop: 6, paddingLeft: indent, color: \"#241430cc\", fontSize: 13 }}>{detailText}</div>\n </details>\n </td>\n </tr>\n <tr>{[\"#1041\", \"R. Okafor\", \"Processing\", \"£128.50\"].map((c, j) => <td key={j} style={cell}>{c}</td>)}</tr>\n <tr>{[\"#1040\", \"M. Iqbal\", \"Shipped\", \"£22.00\"].map((c, j) => <td key={j} style={cell}>{c}</td>)}</tr>\n </tbody>\n </table>\n </div>\n </div>\n );\n}" }
Save
History