@molecule/app-vendor-card-svelte

Feature · vendor-card · App (browser) · v1.1.3 · Apache-2.0

Seller / vendor / agent profile card with logo, description, rating, badges

npm install @molecule/app-vendor-card-svelte

npm · Source on GitHub

How it works

@molecule/app-vendor-card-svelte is a ready-made vendor-card 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 { VendorCard } from '@molecule/app-vendor-card-svelte'
  import { Button } from '@molecule/app-ui-svelte'
</script>

<VendorCard
  name="Acme Supplies"
  logoSrc="/logos/acme.png"
  description="Industrial parts, fast shipping"
  rating={4.7}
  reviewCount={312}
  memberSince="Jan 2021"
  onClick={() => console.log('open vendor page')}
>
  {#snippet badges()}
    <span>Verified</span>
  {/snippet}
  {#snippet actions()}
    <Button size="sm" onclick={() => console.log('follow')}>Follow</Button>
  {/snippet}
</VendorCard>

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

Reference

Vendor / seller / agent profile card.

Exports VendorCard — Avatar/logo + name + tagline + rating/review count

  • member-since + badges + actions row, on the shared Card. It is the Svelte counterpart of @molecule/app-vendor-card-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.ts JSDoc, not this file.

Quick Start

<script lang="ts">
  import { VendorCard } from '@molecule/app-vendor-card-svelte'
  import { Button } from '@molecule/app-ui-svelte'
</script>

<VendorCard
  name="Acme Supplies"
  logoSrc="/logos/acme.png"
  description="Industrial parts, fast shipping"
  rating={4.7}
  reviewCount={312}
  memberSince="Jan 2021"
  onClick={() => console.log('open vendor page')}
>
  {#snippet badges()}
    <span>Verified</span>
  {/snippet}
  {#snippet actions()}
    <Button size="sm" onclick={() => console.log('follow')}>Follow</Button>
  {/snippet}
</VendorCard>

Type

feature

Installation

npm install @molecule/app-vendor-card-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte

API

Interfaces

VendorCardProps

Props accepted by the VendorCard component.

interface VendorCardProps {
  /** Vendor / seller display name (a string or a snippet). */
  name: Snippet | string
  /** Optional logo URL — falls back to Avatar text initials. */
  logoSrc?: string
  /** Tagline / one-liner (a string or a snippet). */
  description?: Snippet | string
  /** 0-5 average rating. */
  rating?: number
  /** Total review count. */
  reviewCount?: number
  /** Member-since date display (a string or a snippet). */
  memberSince?: Snippet | string
  /** Optional badges row (Verified, Top seller, etc.). */
  badges?: Snippet | string
  /** Right-side actions (Follow, Message, Visit shop). */
  actions?: Snippet | string
  /** Optional click handler on the body. */
  onClick?: () => void
  /** Extra classes. */
  className?: string
}

Constants

VendorCard

const VendorCard: LegacyComponentType

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-svelte ^3.14.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-svelte ^1.1.0
  • svelte ^5.0.0

Runtime Dependencies

  • @molecule/app-svelte
  • @molecule/app-ui
  • @molecule/app-ui-svelte
  • svelte

Composes Card + Avatar from @molecule/app-ui-svelte. onClick makes the whole card clickable but adds no keyboard handler or role — put primary navigation in actions buttons for accessibility. rating renders a single ★ plus the number (toFixed(1)), not a five-star row; reviewCount renders only when rating is also set. When name is not a plain string the Avatar alt falls back to hardcoded 'Vendor'. All text slots (description, memberSince, badges, actions) are pre-translated — no locale bond; React's node props arrive as snippets or plain strings. Props (documented on the exported VendorCardProps interface): name, logoSrc, description, rating, reviewCount, memberSince, badges, actions, onClick, className.