row() on a header element
import { html, renderApp } from 'mates';
import { Text, FilledButton, OutlinedButton, TextButton, row } from 'mates-ui';
const App = () => () => html`
<div style="max-width:28rem;width:100%;border:1px solid var(--md-color-border);border-radius:var(--md-radius-lg);overflow:hidden;">
<header ${row("between", "center", { gap: "var(--md-space-2)", px: "var(--md-space-4)", py: "var(--md-space-3)" })}>
${Text("Acme", { type: "title-sm" })}
<div ${row("start", "center", { gap: "var(--md-space-1)" })}>
${TextButton("Docs", { size: "sm" })}
${OutlinedButton("Sign in", { size: "sm" })}
</div>
</header>
</div>
`;
renderApp(App, document.getElementById('app'));
col() on a ul
import { html, renderApp } from 'mates';
import { Text, col } from 'mates-ui';
const TASKS = ["Review PR #142", "Update docs", "Deploy to staging", "Write release notes"];
const App = () => () => html`
<ul style="list-style:none;padding:0;margin:0;max-width:24rem;width:100%;"
${col("start", "stretch", { gap: "var(--md-space-1)" })}>
${TASKS.map((text) => html`
<li style="padding:var(--md-space-2);border-radius:var(--md-radius-sm);background:var(--md-surface-control);">
${Text(text, { type: "body-sm" })}
</li>
`)}
</ul>
`;
renderApp(App, document.getElementById('app'));
box() for spacing and surface
import { html, renderApp } from 'mates';
import { Text, box } from 'mates-ui';
const App = () => () => html`
<main ${box({ maxw: "400px", mx: "auto", p: 3, bgcolor: "var(--md-surface-card)", br: "var(--md-radius-lg)" })}>
${Text("Centered with box()", { type: "title-sm" })}
${Text("maxw=400px, mx=auto, p=3, bgcolor, br", { type: "body-sm", color: "muted" })}
</main>
`;
renderApp(App, document.getElementById('app'));