@molecule/app-info-display-svelte
Feature · info-display · App (browser) · v1.1.2 · Apache-2.0
InfoCard and DefinitionList for structured label/value metadata display
npm install @molecule/app-info-display-svelteHow it works
@molecule/app-info-display-svelte is a ready-made info-display 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 { InfoCard } from '@molecule/app-info-display-svelte'
const fields = [
{ label: 'Industry', value: 'Technology' },
{ label: 'Founded', value: '2018' },
{ label: 'Employees', value: '120–150' },
]
</script>
<InfoCard title="Company Details" {fields} columns={2} dataMolId="company-info-card" />Works with: @molecule/app-svelte, @molecule/app-ui, @molecule/app-ui-svelte
Reference
Svelte InfoCard and DefinitionList for structured label/value metadata.
Exports:
<InfoCard>— Card-wrapped DefinitionList with title, icon, actions.<DefinitionList>— standalone label/value grid.DefinitionFieldtype.
This is the Svelte counterpart of @molecule/app-info-display-react: the
same export names, the same props (React names), 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 { InfoCard } from '@molecule/app-info-display-svelte'
const fields = [
{ label: 'Industry', value: 'Technology' },
{ label: 'Founded', value: '2018' },
{ label: 'Employees', value: '120–150' },
]
</script>
<InfoCard title="Company Details" {fields} columns={2} dataMolId="company-info-card" />
Type
feature
Installation
npm install @molecule/app-info-display-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte
API
Interfaces
DefinitionField
A single label/value pair rendered inside a DefinitionList.
interface DefinitionField {
/** Label content, shown beside the field's icon. */
label: NodeProp
/** Rendered value. */
value: NodeProp
/** Optional icon rendered to the left of the label. */
icon?: NodeProp
}
DefinitionListProps
Props for DefinitionList.
interface DefinitionListProps {
/** Fields to render. */
fields: DefinitionField[]
/** Grid column count. Defaults to `1`. */
columns?: 1 | 2 | 3
/** Extra classes. */
className?: string
}
InfoCardProps
Props for InfoCard.
interface InfoCardProps {
/** Card heading. */
title: NodeProp
/** Optional leading icon. */
icon?: NodeProp
/** Optional right-side header actions. */
actions?: NodeProp
/** Structured fields to display. */
fields: DefinitionField[]
/**
* Grid column count — `1` stacks labels above values, `2+` puts labels beside
* values. Defaults to `1`.
*/
columns?: 1 | 2 | 3
/** Extra classes on the outer Card. */
className?: string
/** `data-mol-id` for AI-agent selectors. */
dataMolId?: string
}
Constants
DefinitionList
const DefinitionList: LegacyComponentType
InfoCard
const InfoCard: LegacyComponentType
Injection Notes
Requirements
Peer dependencies:
@molecule/app-svelte^3.5.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-sveltesvelte
Purely presentational: pass already-formatted / already-translated nodes as
labels and values. getClassMap() requires a bonded ClassMap (e.g.
@molecule/app-ui-tailwind) — there is no other wiring. columns={1} stacks
label above value; 2/3 arrange fields in a grid. Node-valued props
(title, icon, actions, and each field's label/value/icon) take a
snippet, or plain text.