@molecule/app-list-item-row-svelte
Feature · list-item-row · App (browser) · v1.2.3 · Apache-2.0
Thumbnail + title + subtitle + metadata + actions row (nav lists, mobile menus)
npm install @molecule/app-list-item-row-svelteHow it works
@molecule/app-list-item-row-svelte is a ready-made list-item-row feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.
<script lang="ts">
import { ListItemRow } from '@molecule/app-list-item-row-svelte'
declare function navigate(path: string): void
</script>
<ListItemRow
title="Project Alpha"
subtitle="Last edited 2 hours ago"
metadata="3 collaborators · 12 files"
onClick={() => navigate('/projects/alpha')}
>
{#snippet leading()}
<img src="/icons/folder.svg" alt="" width={32} height={32} />
{/snippet}
</ListItemRow>Works with: @molecule/app-svelte, @molecule/app-ui, @molecule/app-ui-svelte
Reference
Svelte generic list-item row.
Exports <ListItemRow> — leading slot (icon/avatar/thumbnail) + up to three
text lines (title / subtitle / metadata) + right-side actions. Props: title,
subtitle?, metadata?, leading?, actions?, onClick?, selected?,
disabled?, density? ('comfortable' default | 'compact'), className?.
Use for nav lists, mobile menus, search results, picker dialogs, inbox threads.
For table rows use <RowWithActions> from @molecule/app-data-table-ui-svelte
instead — this component is not a <tr>. It is the Svelte counterpart of
@molecule/app-list-item-row-react: same props and the same DOM for the same
input.
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Quick Start
<script lang="ts">
import { ListItemRow } from '@molecule/app-list-item-row-svelte'
declare function navigate(path: string): void
</script>
<ListItemRow
title="Project Alpha"
subtitle="Last edited 2 hours ago"
metadata="3 collaborators · 12 files"
onClick={() => navigate('/projects/alpha')}
>
{#snippet leading()}
<img src="/icons/folder.svg" alt="" width={32} height={32} />
{/snippet}
</ListItemRow>
Type
feature
Installation
npm install @molecule/app-list-item-row-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte
API
Interfaces
ListItemRowProps
Props accepted by the ListItemRow component.
interface ListItemRowProps {
/** Title — first line. A snippet renders inline. */
title: Snippet | string | number
/** Optional second line (excerpt, description). A snippet renders inline. */
subtitle?: Snippet | string | number
/** Optional third line (metadata — timestamps, counts, tags). A snippet renders inline. */
metadata?: Snippet | string | number
/** Optional leading slot — icon, avatar, thumbnail image. A snippet renders inline. */
leading?: Snippet | string | number
/** Optional right-side actions (buttons, action menu). A snippet renders inline. */
actions?: Snippet | string | number
/** Loaded boolean action rendered as its own native button, independently of read-only metadata. */
toggle?: OptimisticToggleButtonProps
/**
* Called when the row is activated. The whole row is clickable through a
* transparent native button over it, named by the title; the inner controls
* (the `actions` slot) sit above it and keep their own clicks.
*/
onClick?: () => void
/** When true, sets `aria-current="true"` on the row — no built-in visual highlight; style it via `className` or host CSS. */
selected?: boolean
/** When true, renders in a disabled visual state. */
disabled?: boolean
/** Dense vs comfortable spacing. Defaults to `'comfortable'`. */
density?: 'comfortable' | 'compact'
/** Extra classes. */
className?: string
}
Constants
ListItemRow
const ListItemRow: LegacyComponentType
Injection Notes
Requirements
Peer dependencies:
@molecule/app-svelte^3.13.0 || ^4.0.0@molecule/app-ui^1.0.1@molecule/app-ui-svelte^1.1.0svelte^5.0.0
Runtime Dependencies
-
@molecule/app-svelte -
@molecule/app-ui -
@molecule/app-ui-svelte -
svelte -
selectedonly sets thearia-current="true"attribute — no built-in highlight. Pass a highlight class viaclassName(or target[aria-current="true"]in host CSS) to make selection visible. -
With
onClickthe whole row is clickable through a transparent native button over it, named by the title (aria-labelledby); Enter / Space on that button run the same handler a click anywhere on the row runs, and the inner controls (theactionsslot) sit above the button and keep their own clicks. -
disabledhalves the opacity and disables the open button (no pointer cursor, no activation); there is nodata-mol-idprop. -
Styling resolves through
getClassMap()— wire a ClassMap bond first. -
Node-valued props (
title,leading,actions, …) take a snippet or a plain value — both render inline.