Stock Line, animated React component
- Pro
- Dashboards
- Hover
- Spring
A trading-app price chart: scrub along it and a dot rides the line while the price rolls digit by digit and the change turns green or red. Switching range morphs the line into its new shape, and on 1D the last price keeps ticking live.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| theme | "auto" | "light" | "dark" | "auto" | "auto" follows the page's .dark class; "light" or "dark" pins the card's palette. |
| symbol | string | "NXUS" | Ticker shown in the corner and read out in the chart's label. |
| smooth | boolean | true | Draw the line as smooth curves instead of straight segments. |
| fill | boolean | true | Fade a gradient area under the line. |
| up | string | "#30d158" | Line and change colour while the price is at or above the range's open. |
| down | string | "#ff453a" | Line and change colour while the price is below the range's open. |
| autoplay | boolean | false | Cycles through the ranges and sweeps the dot along each one until someone interacts. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry with your API key
Stock Line is a Pro item, so the CLI has to send your API key. Do this once per project:
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
nxs_and is shown only once. - In your project root, next to
package.json, create a file named.env.localwith this line, using your own key:NEXUS_API_KEY=nxs_your_key_here
- Open
components.jsonand add this entry inside the outermost braces, next to"aliases". Leave{name}and${NEXUS_API_KEY}exactly as written; the CLI fills them in:"registries": { "@nexus-labs": { "url": "https://www.nexus-ui.com/api/registry/{name}", "headers": { "Authorization": "Bearer ${NEXUS_API_KEY}" } } }
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
How Stock Line works
A price chart in the style of a trading app. Run along it and a dot rides the line while the price rolls digit by digit and the change turns green or red. Switching range morphs the line from one shape into the next instead of redrawing it, and on 1D the last point keeps ticking live.
The source, the install command and the build prompt come with Pro.

