@marketdataapp/ui

Shared component library for MarketData properties

Typography

font-sans

The quick brown fox jumps over the lazy dog.

font-mono

The quick brown fox jumps over the lazy dog.

font-quicksand

The quick brown fox jumps over the lazy dog.

Brand Colors

lightorange
#FFDFB9
darkorange
#E83155
lightblue
#0085f2
darkblue
#003286
bluebg
#001A6C

Semantic Colors

Token triplets (background / border / text) for each admonition type, with dedicated dark variants. See the Admonitions section below for the rendered component.

Note
bg border text darkbg darkborder darktext
Tip
Info
Warning
Danger

Admonitions

Docusaurus-style callout boxes. Five built-in types, each with its own icon (sourced from Docusaurus). Supports custom titles, multiple paragraphs, links, inline code, lists, and more.

Default Types

Each type uses its semantic color tokens for background, left border, and text — and ships with the matching SVG icon.

Note

Some content with Markdown syntax. Check this api.

Tip

Some content with Markdown syntax. Check this api.

Info

Some content with Markdown syntax. Check this api.

Warning

Some content with Markdown syntax. Check this api.

Danger

Some content with Markdown syntax. Check this api.

Custom Titles

Replace the default label with anything — including markdown formatting. Mirrors the Docusaurus :::tip[Custom Title] syntax.

Pro Tip!

You can rate-limit your requests with the X-Api-Ratelimit-Reset header — no need to poll.

Did you know?

Our real-time data feeds use the same NMS-distributed sources as the major exchanges.

Heads up — rate limit changes

Free-tier requests are capped at 100/day starting in May.

Rich Content

Multiple paragraphs, ordered/unordered lists, inline code, and links all flow naturally inside .admonition-content.

Migrating from v3

Upgrading the SDK from v3 to v4 is mostly a drop-in replacement, but there are a few breaking changes you should know about.

The most common migration steps:

  1. Replace marketdata.client(key) with new MarketData({ apiKey: key }).
  2. Switch from positional arguments to keyword options on every endpoint.
  3. Update error handling — exceptions are now MarketDataError subclasses rather than plain Error.

For the full diff, see the migration guide.

Don’t commit your API key

If your API key ever ends up in a public repo, rotate it immediately:

  • Open your API Keys page.
  • Click Revoke on the leaked key.
  • Generate a new one and update your environment variables.

Leaked keys can be abused before our anomaly detection catches the spike — rotation is always faster than recovery.

Without an Icon

Omit .admonition-icon for a text-only heading. Drop the heading entirely if you only need the colored container.

Note

An admonition heading without the leading icon — title text only.

Tip: A bare admonition with no heading at all — just the colored container around inline content. Useful for short asides where the visual treatment is enough context.

Markup Pattern

<div class="admonition admonition-tip">
  <div class="admonition-heading">
    <span class="admonition-icon"></span>
    <span>Pro Tip!</span>
  </div>
  <div class="admonition-content">
    <p>Some <strong>content</strong> with <a href="...">a link</a>.</p>
  </div>
</div>
.admonition .admonition-note .admonition-tip .admonition-info .admonition-warning .admonition-danger .admonition-heading .admonition-icon .admonition-content

Gradients & Shadows

bg-gradient-orange
bg-gradient-blue
shadow-line
shadow-darkline
shadow-diffuse

Buttons

Hover to see gradient transitions. All buttons include disabled states.

.btn-orange-to-blue
.btn-blue-to-orange
.btn-outline-to-orange
.btn-outline-to-blue
.btn-orange-to-outline
.btn-blue-to-outline

Loading state

Primary buttons (.btn-orange-to-blue and .btn-blue-to-orange) automatically render a shimmer effect when HTMX adds the .htmx-request class during an in-flight request, or when you set aria-busy="true" manually. The gradient angle rotates 360° via an animated @property custom property; clicks are blocked (pointer-events: none) so consumers don't double-submit, and the cursor switches to wait.

← click either; random 1–5s

Optional text swap: wrap the default content in [data-btn-default] and add a [data-btn-loading] sibling. CSS hides the first and reveals the second while loading, and the loading span gets inline-flex + a small gap so a .spinner icon sits cleanly next to the text.

<!-- HTMX: zero JS, .htmx-request is added automatically -->
<button class="btn-orange-to-blue" hx-post="/save">
  <span data-btn-default>Save changes</span>
  <span data-btn-loading>
    <span class="spinner w-4 h-4"></span>
    Saving…
  </span>
</button>

<!-- Manual / framework-agnostic via aria-busy -->
button.setAttribute('aria-busy', 'true');   // start
button.removeAttribute('aria-busy');        // done

Spinner

Indeterminate loading indicator. The SVG track + arc live entirely in CSS via mask-image, so consumer markup is just one empty wrapper with role="status" and an sr-only label. Default size is w-8 h-8; override with any Tailwind width/height utility. The arc follows currentColor — set it with any text-* utility. The track defaults to neutral-tertiary; override via the --spinner-track custom property.

Loading...
Loading...
Loading...
Loading...
Loading...
.spinner

Progress Bar

Thin horizontal bar for determinate progress. Two utilities: a .progress-bar track and a .progress-bar-fill child whose width is driven by an inline style="width: N%" (or a CSS custom property). Default height is h-2; override with h-1.5 or h-2.5 on the track for Flowbite small/large sizes. The fill ships in the brand orange gradient by default; modifier classes swap it for the brand blue gradient (-blue) or solid Flowbite semantic colors (-info, -success, -danger) that auto-swap for dark mode. Width changes animate over 400ms so updates from PHP/JS feel smooth.

Default (45%)
Complete (100%)
Small — h-1.5 override (30%)
Large — h-2.5 override (75%)
Brand blue gradient — -blue (60%)
Info — -info (solid Flowbite blue, 50%)
Success — -success (solid Flowbite green, 90%)
Danger — -danger (solid Flowbite red, 15%)

Markup Pattern

<div class="progress-bar" role="progressbar"
     aria-valuenow="45" aria-valuemin="0" aria-valuemax="100">
  <div class="progress-bar-fill" style="width: 45%"></div>
</div>
.progress-bar .progress-bar-fill .progress-bar-fill-blue .progress-bar-fill-info .progress-bar-fill-success .progress-bar-fill-danger

Form Inputs

Text fields and their states, dropdowns, the search group, the copy group, radio buttons and checkboxes all live on their own page now — there are enough variants that they were crowding out the rest of the library here.

Form Inputs →

Status Indicators

A coloured dot for system / user / item status. Sized in em so it scales with the parent font-size — drop one into a heading, a paragraph, or a .badge-pill and it adopts the right size. Add .indicator-pulse for an animated halo. The colour carries the meaning, so always pair with an aria-label.

For reliable vertical alignment with its label, wrap the dot and its text in inline-flex items-center gap-2. The bare-inline fallback (vertical-align: middle) aligns to x-height rather than cap-line and drifts noticeably at larger font sizes.

Colours

Operational Degraded Outage Unknown

Pulse

Use the pulse halo when the status is actively changing or warrants extra attention. The halo is a pseudo-element, so screen readers ignore it.

Degraded Outage

Sizes via inheritance

The dot inherits its size from the parent's font-size. .indicator-sm and .indicator-lg nudge it relative to that baseline.

Small text — small dot

Body text — default dot

Larger text — larger dot

.indicator-sm at body size .indicator-lg at body size

Inside a pill

Composes cleanly with .badge-pill.

Operational Degraded Outage
.indicator .indicator-{success|warning|danger|neutral} .indicator-pulse .indicator-{sm|lg}

Badges

Standard Badges

Blue Gray Red Green Yellow Indigo Purple Pink

Pill Badges

Active Pending Expired
.badge .badge-{color} .badge-pill-{color}

Clickable Badges

A badge that carries a link styles itself as one — there is no opt-in class. Hover the badges below, then press Tab through them: each rings in its own colour. The row underneath is the same markup on a <span>, which is unchanged.

Blue Gray Red Green Yellow Indigo Purple Pink links — 24px tall
Blue Gray Red Green Yellow Indigo Purple Pink labels — 18px tall

Clickable Pills

Active Pending Expired links Active Pending Expired labels
a.badge:any-link --badge-hover-bg --badge-focus-ring

Grid Layout

A 12-column grid system. .grid-layout-12 sets up the grid, then child elements use column spans to control width. .grid-content-position and .grid-content-container handle all spacing automatically — they add horizontal margin on small screens to keep content off the viewport edges, then remove it at larger breakpoints where the grid columns provide the centering. Consumers don't need to add their own margin or padding.

The 12-Column Grid

1
2
3
4
5
6
7
8
9
10
11
12

Column Spans

col-span-12
col-span-6
col-span-6
col-span-4
col-span-4
col-span-4
col-span-3
col-span-6
col-span-3
2
2
2
2
2
2

Content Containers

These preset classes center content and progressively narrow it at wider breakpoints. Both include built-in horizontal margin on small screens (mx-4 / md:mx-6) so content never touches the viewport edge. At xl+ the margin is removed because the grid columns handle the inset.

.grid-content-position
span-12 + mx-4 → xl:span-10 + mx-0 → 2xl:span-8 (position + margin only)

.grid-content-container
same centering + margin + card-surface (background, border, padding, shadow, rounded corners)

.grid-layout-12 .grid-content-container .grid-content-position .card-surface

Review Widget

Review platform rating widget. Renders build-time review data with clickable links to the review profile page.

initResenaWidget({ version: 'large' })

Resize below 1024px to see the compact view (text labels hide, only stars + logo remain).

initResenaWidget({ version: 'small' })
initResenaWidget() .resena-widget .resena-small