@molecule/app-info-display-solid

Feature · info-display · App (browser) · v1.1.1 · Apache-2.0

InfoCard and DefinitionList for structured label/value metadata display

npm install @molecule/app-info-display-solid

npm · Source on GitHub

How it works

@molecule/app-info-display-solid 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.

import { InfoCard } from '@molecule/app-info-display-solid'

export function CompanyDetails() {
  return (
    <InfoCard
      title="Company Details"
      fields={[
        { label: 'Industry', value: 'Technology' },
        { label: 'Founded', value: '2018' },
        { label: 'Employees', value: '120–150' },
      ]}
      columns={2}
      dataMolId="company-info-card"
    />
  )
}

Works with: @molecule/app-solid, @molecule/app-ui, @molecule/app-ui-solid

Reference

Solid InfoCard and DefinitionList for structured label/value metadata.

Exports:

  • <InfoCard> — Card-wrapped DefinitionList with title, icon, actions.
  • <DefinitionList> — standalone label/value grid.
  • DefinitionField type.

This is the Solid 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.ts JSDoc, not this file.

Quick Start

import { InfoCard } from '@molecule/app-info-display-solid'

export function CompanyDetails() {
  return (
    <InfoCard
      title="Company Details"
      fields={[
        { label: 'Industry', value: 'Technology' },
        { label: 'Founded', value: '2018' },
        { label: 'Employees', value: '120–150' },
      ]}
      columns={2}
      dataMolId="company-info-card"
    />
  )
}

Type

feature

Installation

npm install @molecule/app-info-display-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

DefinitionField

A single label/value pair rendered inside a DefinitionList.

interface DefinitionField {
  /** Label content (usually a translated string or JSX). */
  label: JSX.Element
  /** Rendered value. */
  value: JSX.Element
  /** Optional icon rendered to the left of the label. */
  icon?: JSX.Element
}

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: JSX.Element
  /** Optional leading icon. */
  icon?: JSX.Element
  /** Optional right-side header actions. */
  actions?: JSX.Element
  /** 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
}

Functions

DefinitionList(props)

Structured label/value pair list. Use standalone or inside <InfoCard>. Apps pass already-formatted values (dates, currency, status pills, etc.) as nodes.

columns={1} stacks each label above its value; 2/3 arrange the fields in a grid. The list uses ClassMap tokens only, so the styling library can be swapped without touching consumers.

This is the Solid counterpart of @molecule/app-info-display-react's DefinitionList.

function DefinitionList(props: DefinitionListProps): JSX.Element
  • props — Component props (see DefinitionListProps).

Returns: The rendered definition list.

InfoCard(props)

Card wrapping a <DefinitionList> of metadata fields.

Used all over CRM/helpdesk/finance detail pages (CompanyInfoCard, DealInfoCard, TicketDetailsCard, TransactionDetailsCard) — same shape everywhere, only the fields differ.

function InfoCard(props: InfoCardProps): JSX.Element
  • props — Component props (see InfoCardProps).

Returns: The rendered info card.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-solid ^3.5.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-solid ^1.1.0
  • solid-js ^1.8.0

Runtime Dependencies

  • @molecule/app-solid
  • @molecule/app-ui
  • @molecule/app-ui-solid
  • solid-js

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.