Cards & Layout
Card
Article element with header/body/footer slots and hover affordance.
- Element
<article>- Module
@basenative/components- Function
renderCard
Quick start
Import the render function and call it from your server template.
import { renderCard } from '@basenative/components';
renderCard({ header: 'Title', body: '<p>Body</p>', footer: 'Updated now' });
Examples
Each block is a real server render — no mockups, no virtual DOM.
Article with header, body, footer
Built on the article element. Hover lifts the border.
renderCard({
header: 'Card Title',
body: '<p>Card body content…</p>',
footer: 'Updated 2 hours ago',
})
Live editing
Type in the input to update the card title in real time.
const title = signal('Project Atlas');
// renderCard() is a server helper; in the browser the signal drives the markup directly.
effect(() => {
slot.innerHTML =
'<article data-bn="card">' +
'<header data-bn="card-header">' + title() + '</header>' +
'<div data-bn="card-body"><p>The card title comes from a signal.</p></div>' +
'<footer data-bn="card-footer">Live preview</footer>' +
'</article>';
});
input.oninput = (e) => title.set(e.target.value || ' ');
Options
Arguments accepted by renderCard().
| Option | Type | Default | Description |
|---|---|---|---|
header |
string |
'' |
Card header HTML. |
body |
string |
'' |
Card body HTML. |
footer |
string |
'' |
Card footer HTML. |