Team plan
For up to ten people.
Shared projects, roles, and one invoice.
Components › Components
Demos show your theme.
A box with a header, a body and a footer.
For up to ten people.
Shared projects, roles, and one invoice.
@import uiCard from './card.tscl'
@import uiButton from './button.tscl'
<div class="demo">
<uiCard>
@slot('header') {
<h2>Team plan</h2>
<p>For up to ten people.</p>
}
<p>Shared projects, roles, and one invoice.</p>
@slot('footer') {
<uiButton variant="outline">Compare</uiButton>
<uiButton>Choose</uiButton>
}
</uiCard>
</div>
<style scoped>
:scope {
display: grid;
gap: 12px;
padding: 24px;
border: 1px solid var(--ui-border);
border-radius: var(--ui-radius);
background: var(--ui-bg);
color: var(--ui-fg);
}
</style>Copy it into your components folder (next to the others) as card.tscl.
{{-- Card: an <article> with a header, a body and a footer; a header or footer you don't fill is hidden. parts takes
attributes (class, style, data-*) for each piece: header, body, footer. --}}
@input parts: { header?: Record<string, string | boolean>; body?: Record<string, string | boolean>; footer?: Record<string, string | boolean> } = {}
<article data-part="card">
<header [...]="parts.header ?? {}" data-part="card-header"><slot name="header" /></header>
<div [...]="parts.body ?? {}" data-part="card-body"><slot /></div>
<footer [...]="parts.footer ?? {}" data-part="card-footer"><slot name="footer" /></footer>
</article>
<style scoped>
@layer theme, base, components, utilities;
@layer components {
:where(:scope) {
display: grid;
gap: 16px;
padding: 20px;
border: 1px solid var(--ui-border);
border-radius: calc(var(--ui-radius) * 1.5);
background: var(--ui-card);
color: var(--ui-card-fg);
font-family: var(--ui-font);
}
:where([data-part='card-header'] :is(h1), :where(h2), :where(h3), :where(h4)) {
margin: 0;
font-size: calc(var(--ui-font-size) + 4px);
}
:where([data-part='card-header'] p) {
margin: 4px 0 0;
color: var(--ui-muted);
font-size: var(--ui-font-size);
}
:where([data-part='card-footer']) {
display: flex;
gap: 8px;
justify-content: flex-end;
}
:where([data-part='card-header']:empty),
:where([data-part='card-footer']:empty) {
display: none;
}
}
</style>class, style, id, aria-* and data-* written on the tag land on its root element; class and style merge with its own.parts takes an object of attributes (class, style, data-*) for each of header, body, footer, spread on that piece: [parts]="{ header: { class: 'my-header' } }".data-part names card, card-header, card-body, card-footer.:where()) and sits in @layer components, so your own CSS and Tailwind utilities override it.