@molecule/app-ticker-row-vue

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

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

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

npm · Source on GitHub

How it works

@molecule/app-ticker-row-vue 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.

import { createApp, defineComponent, h } from 'vue'
import { TickerRow } from '@molecule/app-ticker-row-vue'

declare function openAsset(id: string): void

const Watchlist = defineComponent({
  setup() {
    return () => [
      h(TickerRow, {
        symbol: 'BTC',
        name: 'Bitcoin',
        price: '$67,420',
        changePct: 2.34,
        meta: '$1.3T',
        onClick: () => openAsset('btc'),
      }),
    ]
  },
})

createApp(Watchlist).mount('#app')

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

Reference

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

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

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 { createApp, defineComponent, h } from 'vue'
import { TickerRow } from '@molecule/app-ticker-row-vue'

declare function openAsset(id: string): void

const Watchlist = defineComponent({
  setup() {
    return () => [
      h(TickerRow, {
        symbol: 'BTC',
        name: 'Bitcoin',
        price: '$67,420',
        changePct: 2.34,
        meta: '$1.3T',
        onClick: () => openAsset('btc'),
      }),
    ]
  },
})

createApp(Watchlist).mount('#app')

Type

feature

Installation

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

API

Interfaces

TickerRowProps

Props accepted by the TickerRow component.

interface TickerRowProps {
  /** Symbol / ticker display ("BTC", "AAPL"). A prop or the same-named slot — both work. */
  symbol: VNodeChild
  /** Full name display ("Bitcoin", "Apple Inc."). A prop or the same-named slot — both work. */
  name?: VNodeChild
  /** Optional leading icon / logo. A prop or the same-named slot — both work. */
  icon?: VNodeChild
  /** Current price (formatted string). A prop or the same-named slot — both work. */
  price: VNodeChild
  /** Period change percentage. Used for direction + color. */
  changePct?: number
  /** Period change formatted display (defaults to `changePct` formatted). A prop or the same-named slot — both work. */
  changeDisplay?: VNodeChild
  /** Optional sparkline node (pass `<Sparkline values={...} />` from `app-sparkline-vue`). A prop or the same-named slot — both work. */
  sparkline?: VNodeChild
  /** Optional volume / market-cap display. May hold a control; it keeps its own clicks. A prop or the same-named slot — both work. */
  meta?: VNodeChild
  /**
   * 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

Financial ticker row — symbol + price + change% + optional sparkline. Use for crypto trackers, stock watchlists, market dashboards. changePct drives the ▲/▼/– direction and the theme's success/error text tokens (cm.textSuccess / cm.textError); price and meta are opaque display nodes — the app owns formatting, and the default percentage text comes from Intl.NumberFormat in the app's active locale. While onClick 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. A native button turns Enter and Space into the same click itself.

const TickerRow: DefineComponent<
  ExtractPropTypes<{
    symbol: null
    name: null
    icon: null
    price: null
    changePct: { type: NumberConstructor; default: undefined }
    changeDisplay: null
    sparkline: null
    meta: null
    onClick: { type: PropType<() => void>; default: undefined }
    className: { type: StringConstructor; default: undefined }
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      symbol: null
      name: null
      icon: null
      price: null
      changePct: { type: NumberConstructor; default: undefined }
      changeDisplay: null
      sparkline: null
      meta: null
      onClick: { type: PropType<() => void>; default: undefined }
      className: { type: StringConstructor; default: undefined }
    }>
  > &
    Readonly<{}>,
  { changePct: number; onClick: () => void; className: string },
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>
  • props — Component props (see TickerRowProps).

Returns: The ticker row component.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-vue ^1.1.0
  • @molecule/app-vue ^3.13.0 || ^4.0.0
  • vue ^3.5.0

Runtime Dependencies

  • @molecule/app-ui

  • @molecule/app-ui-vue

  • @molecule/app-vue

  • vue

  • 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, …) arrive as a prop AND a same-named slot; components accept either.

Translations

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