React Trend Component

1.2.5 · abandoned · verified Sun Apr 19

react-trend is a lightweight React component designed to render simple, scalable SVG sparkline-style trend graphs. Unlike complex charting libraries, it focuses on doing one thing well: creating elegant visualizations like those seen on GitHub or Twitter for activity feeds. It supports data as arrays of numbers or objects, offers gradient and smoothing options, and includes an auto-draw animation feature. The component renders directly to SVG, ensuring crisp visuals at any scale. While its latest stable version is 1.2.5, released over six years ago, it remains functional for basic use cases in older React environments. The project is effectively abandoned, with no recent updates or maintenance, meaning it may not be compatible with modern React versions (17+) or features like Strict Mode or Concurrent Mode, and lacks ongoing security patches. It is zero-dependency beyond React itself.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates a basic trend graph with animation, smoothing, and a multi-color gradient.

import React from 'react';
import Trend from 'react-trend';

const App = () => (
  <div style={{ width: '300px', height: '100px', border: '1px solid #ccc', padding: '10px' }}>
    <h2>Website Traffic Trend</h2>
    <Trend
      data={[0, 10, 5, 22, 3.6, 11, 15, 8, 20]}
      autoDraw
      autoDrawDuration={2000}
      autoDrawEasing="ease-out"
      smooth
      gradient={['#00c6ff', '#F0F', '#FF0']}
      radius={10}
      strokeWidth={3}
      strokeLinecap={'round'}
    />
    <p>Showing recent activity.</p>
  </div>
);

export default App;

view raw JSON →