Skip to content
Back

AI insight cardPro

A metric tile that can tell you why it moved: ask it and a short write-up appears word by word, the main causes line up with signed bars, numbered pins drop onto the trend line as each cause is mentioned, and suggested next questions swap the answer in place.

oxyn add ai-insight-card

Weekly active teams · Last 12 weeks

1,284+16.5%vs 1,102 the 12 weeks before

  • This period
  • 12 weeks before

Active teams

The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • A KPI card that explains its own change: why it moved, which drivers mattered and the next question to ask.

When not to use

Installation

AI insight card is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add ai-insight-card

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Explain

Explains on open.

Weekly active teams · Last 12 weeks

1,284+16.5%vs 1,102 the 12 weeks before

  • This period
  • 12 weeks before

Active teams

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Idle

Waiting for Explain, no previous line (Oxyn extra).

Weekly active teams · Last 12 weeks

1,284+16.5%vs 1,102 the 12 weeks before

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Error

The first answer fails, with Retry (Oxyn extra).

Weekly active teams · Last 12 weeks

1,284+16.5%vs 1,102 the 12 weeks before

  • This period
  • 12 weeks before
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

AiInsightCard

PropTypeDefaultDescription
nowrequiredClockMs—Host clock.
auto_playbooltrueStart explaining at once.
failboolDefault::default()The first answer fails (error scenario).
previousbooltrueShow the previous period's line.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
TabThe ask button, the trend line, then the suggested questions
←or→orHomeorEndOn the trend line, hear week by week
EscHide the week readout

Accessibility

  • The ask button reports whether the write-up is shown; start, stop and failure are read out.
  • Changes show + or − with the colour; causes not yet reached are skipped by screen readers.
  • Suggested questions are toggle buttons, inactive while text is still arriving.
From the spec

Explain has aria-expanded and aria-controls; the chart is a focusable group read point by point with the arrow keys; deltas carry a sign as well as colour; unread drivers are hidden from assistive technology; follow-ups use aria-pressed. Every action returns the line the polite live region announces. The focus outline shows only for keyboard focus.

Motion & interaction

Words stream in; when the answer reaches a driver its numbered marker lights up on the sparkline and its bar grows; follow-up chips swap the answer in place.

Timing

Everything on screen is derived from the host clock now (no timers in the block), so playback, tests and the GPUI view agree.

TransitionDurationEasing
Stream2 words per 34 ms ticklinear
Driver bar400 msease-out

Reduced motion: shimmer, pulses and slides stop; every state keeps its words and icons.

Responsive behaviour

  • Up to 600 px; below 460 px the legend hides and the bars shorten.
Edge cases (spec)

Up to 600 px; below 460 px the legend hides and driver bars shorten; the chart redraws at the card width. Layout follows the block's own width (container queries), never the viewport. Checked at 1440, 768 and 390 px in light and dark with no text overlap. Chrome is monochrome grey; colour is semantic only (success, warning, danger, info) plus data series and the official coloured brand and model marks.

Notes for AI

  • Import AiInsightCard from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: BlocksView in oxyn_gpui.
  • Props to set first: now.
  • It reads a clock (now) for live timers; pass one clock for the whole page rather than one per component.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI