RowList
A list of records. Each row supplies its own cells.
- Field notes Draft
- A single cell can explain this record.
Source
<script lang="ts">
import 'portal-bits/styles.css';
import 'portal-bits/tokens.css';
import type { Snippet } from 'svelte';
let { children }: { children: Snippet } = $props();
</script>
{@render children()}
<script lang="ts">
import RowListExample from './RowListExample.svelte';
</script>
<RowListExample content={"short"} />
<script lang="ts">
import { Badge, Button, Row, RowList } from 'portal-bits';
let { content = 'short' }: { content?: 'short' | 'wrapping' } = $props();
let saved = $state(false);
</script>
<RowList aria-label="Example records">
{#if content === 'short'}
<Row>
<a href="#field-notes">Field notes</a>
<Badge>Draft</Badge>
<Button variant="quiet" onclick={() => (saved = !saved)}>{saved ? 'Saved' : 'Save'}</Button>
</Row>
{:else}
<Row>
<span>A longer synthetic record wraps naturally when the available space is narrow.</span>
<Badge>Draft</Badge>
</Row>
{/if}
<Row><span>A single cell can explain this record.</span></Row>
</RowList>
API reference
These tables list the props and snippets that RowList declares. Attributes passed through to an element or primitive are listed under Forwarded attributes, not here.
Props
| Name | Type | Default | Required | Binding | Description |
|---|---|---|---|---|---|
class | string | "" | No | One-way | Extra classes, added after the component classes. |
Snippets
| Name | Type | Default | Required | Binding | Description |
|---|---|---|---|---|---|
children | Snippet | None | No | One-way | The rows. Place Row elements here. |
Forwarded attributes
- Native `ul` attributes: `id`, `aria-label`, `aria-labelledby`, `data-*`, and handlers.
No data attributes are documented as stable.
Limits
- Rows do not imply navigation or selection. Sorting, pagination, and column headers stay with you.
- The wrapping layout is an adaptation.