@molecule/app-ticker-row-svelte

Feature · ticker-row · App (browser) · v1.1.5 · Apache-2.0

Financial ticker row — symbol, price, change%, sparkline for crypto/stocks/markets

npm install @molecule/app-ticker-row-svelte

npm · Source on GitHub

How it works

@molecule/app-ticker-row-svelte is a ready-made ticker-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 { TickerRow } from '@molecule/app-ticker-row-svelte'

  declare function openAsset(id: string): void
</script>

<TickerRow
  symbol="BTC"
  name="Bitcoin"
  price="$67,420"
  changePct={2.34}
  meta="$1.3T"
  onClick={() => openAsset('btc')}
/>

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

Reference

Svelte financial ticker row — symbol + price + change% + optional sparkline.

Exports <TickerRow>. Use for crypto trackers, stock watchlists, market dashboards. It is the Svelte counterpart of @molecule/app-ticker-row-react: the same props (React names) and the same DOM for the same input. Pair the sparkline snippet with <Sparkline values={...} /> from @molecule/app-sparkline-svelte.

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 { TickerRow } from '@molecule/app-ticker-row-svelte'

  declare function openAsset(id: string): void
</script>

<TickerRow
  symbol="BTC"
  name="Bitcoin"
  price="$67,420"
  changePct={2.34}
  meta="$1.3T"
  onClick={() => openAsset('btc')}
/>

Type

feature

Installation

npm install @molecule/app-ticker-row-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte

API

Interfaces

TickerRowProps

Props accepted by the TickerRow component.

interface TickerRowProps {
  /** Symbol / ticker display ("BTC", "AAPL"). A snippet renders inline. */
  symbol: Snippet | string | number
  /** Full name display ("Bitcoin", "Apple Inc."). A snippet renders inline. */
  name?: Snippet | string | number
  /** Optional leading icon / logo. A snippet renders inline. */
  icon?: Snippet | string | number
  /** Current price (formatted string). A snippet renders inline. */
  price: Snippet | string | number
  /** Period change percentage. Used for direction + color. */
  changePct?: number
  /** Period change formatted display (defaults to `changePct` formatted). A snippet renders inline. */
  changeDisplay?: Snippet | string | number
  /** Optional sparkline node (pass `<Sparkline values={...} />` from `app-sparkline-svelte`). A snippet renders inline. */
  sparkline?: Snippet | string | number
  /** Optional volume / market-cap display. May hold a control; it keeps its own clicks. A snippet renders inline. */
  meta?: Snippet | string | number
  /**
   * Click handler. While it is set the whole row is clickable through a
   * transparent native button laid over it, named by the symbol; the inner
   * controls (the `meta` slot) sit above that button and keep their own
   * clicks.
   */
  onClick?: () => void
  /** Extra classes. */
  className?: string
}

Constants

TickerRow

const TickerRow: 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.6.0
  • svelte ^5.0.0

Runtime Dependencies

  • @molecule/app-svelte

  • @molecule/app-ui

  • @molecule/app-ui-svelte

  • svelte

  • Requires a wired ClassMap bond (getClassMap() throws before bonding). price/meta are opaque display nodes — the app owns number/currency formatting.

  • changePct drives direction (▲/▼/–) and the theme's success/error text tokens (cm.textSuccess / cm.textError). Pass changeDisplay to control the change text; the default formats changePct as a percent in the app's active locale.

  • With onClick the whole row is clickable through a transparent native button laid over it, named by the symbol; the inner controls (the meta slot) sit above that button and keep their own clicks. A native button turns Enter and Space into the same click itself.

  • Node-valued props (icon, sparkline, meta, …) take a snippet or a plain value — both render inline.

Translations

Translation strings are provided by @molecule/app-locales-ticker-row.