Convert Figma logo to code with AI

tremorlabs logotremor

React components to build charts and dashboards

16,249
467
16,249
64

Top Related Projects

71,970

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.

38,137

⚡️ Simple, Modular & Accessible UI Components for your React Applications

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Quick Overview

Tremor is a React component library for building dashboards and data-driven applications. It provides a set of customizable, responsive UI components specifically designed for creating analytics interfaces, charts, and data visualization tools with minimal effort.

Pros

  • Extensive collection of pre-built, customizable components for data visualization
  • Seamless integration with React applications
  • Responsive design out of the box
  • TypeScript support for improved developer experience

Cons

  • Limited to React ecosystem, not suitable for other frameworks
  • Learning curve for developers unfamiliar with data visualization concepts
  • May require additional customization for highly specific use cases
  • Documentation could be more comprehensive for advanced usage

Code Examples

Creating a simple bar chart:

import { BarChart, Card, Title } from "@tremor/react";

const data = [
  { name: "A", value: 10 },
  { name: "B", value: 20 },
  { name: "C", value: 15 },
];

const Chart = () => (
  <Card>
    <Title>Simple Bar Chart</Title>
    <BarChart
      data={data}
      index="name"
      categories={["value"]}
      colors={["blue"]}
      yAxisWidth={48}
    />
  </Card>
);

Creating a KPI card:

import { Card, Metric, Text } from "@tremor/react";

const KPICard = () => (
  <Card>
    <Text>Sales</Text>
    <Metric>$ 34,743</Metric>
  </Card>
);

Using a table component:

import { Table, TableHead, TableRow, TableHeaderCell, TableBody, TableCell, Text } from "@tremor/react";

const data = [
  { name: "Alice", sales: 10000 },
  { name: "Bob", sales: 8000 },
  { name: "Charlie", sales: 12000 },
];

const SalesTable = () => (
  <Table>
    <TableHead>
      <TableRow>
        <TableHeaderCell>Name</TableHeaderCell>
        <TableHeaderCell>Sales</TableHeaderCell>
      </TableRow>
    </TableHead>
    <TableBody>
      {data.map((item) => (
        <TableRow key={item.name}>
          <TableCell>{item.name}</TableCell>
          <TableCell>
            <Text>$ {item.sales}</Text>
          </TableCell>
        </TableRow>
      ))}
    </TableBody>
  </Table>
);

Getting Started

  1. Install Tremor in your React project:

    npm install @tremor/react
    
  2. Import and use Tremor components in your React application:

    import { Card, Text, Metric } from "@tremor/react";
    
    function App() {
      return (
        <Card>
          <Text>Sales</Text>
          <Metric>$ 34,743</Metric>
        </Card>
      );
    }
    
    export default App;
    
  3. Tremor uses Tailwind CSS for styling. Make sure to include Tremor's Tailwind preset in your tailwind.config.js:

    module.exports = {
      content: [
        "./src/**/*.{js,ts,jsx,tsx}",
        "./node_modules/@tremor/**/*.{js,ts,jsx,tsx}",
      ],
      theme: {
        extend: {},
      },
      plugins: [],
    };
    

Competitor Comparisons

71,970

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.

Pros of shadcn/ui

  • More customizable and flexible, allowing for easier integration into existing projects
  • Provides a wider range of UI components and utilities
  • Offers better TypeScript support and type safety

Cons of shadcn/ui

  • Less opinionated design, requiring more effort to achieve a cohesive look
  • Steeper learning curve due to its modular nature and extensive customization options
  • May require more setup and configuration compared to Tremor

Code Comparison

shadcn/ui:

import { Button } from "@/components/ui/button"

export function Example() {
  return <Button variant="outline">Click me</Button>
}

Tremor:

import { Button } from "@tremor/react"

export function Example() {
  return <Button variant="secondary">Click me</Button>
}

Both libraries offer similar component usage, but shadcn/ui provides more customization options through its modular approach. Tremor focuses on pre-built, data-visualization-oriented components, while shadcn/ui offers a broader range of general-purpose UI elements. The choice between the two depends on project requirements, with Tremor being more suitable for quick dashboard setups and shadcn/ui offering greater flexibility for custom designs.

38,137

⚡️ Simple, Modular & Accessible UI Components for your React Applications

Pros of Chakra UI

  • More extensive component library with a wider range of UI elements
  • Greater flexibility in customization and theming
  • Larger community and ecosystem, leading to more resources and third-party extensions

Cons of Chakra UI

  • Steeper learning curve due to its extensive API and customization options
  • Potentially larger bundle size, which may impact performance in some applications

Code Comparison

Chakra UI:

import { Box, Button, Text } from "@chakra-ui/react"

function Example() {
  return (
    <Box>
      <Text>Hello, Chakra UI!</Text>
      <Button colorScheme="blue">Click me</Button>
    </Box>
  )
}

Tremor:

import { Card, Text, Button } from "@tremor/react"

function Example() {
  return (
    <Card>
      <Text>Hello, Tremor!</Text>
      <Button>Click me</Button>
    </Card>
  )
}

Both libraries offer a similar component-based approach, but Chakra UI provides more granular control over styling and theming. Tremor focuses on simplicity and ease of use, particularly for dashboard and analytics interfaces. While Chakra UI is more versatile for general-purpose UI development, Tremor excels in creating data-rich applications with less configuration required.

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.

Pros of Headless UI

  • More flexible and customizable, allowing for greater control over styling and behavior
  • Broader range of components, including dialogs, menus, and transitions
  • Framework-agnostic, supporting React, Vue, and Alpine.js

Cons of Headless UI

  • Requires more setup and configuration to achieve desired styling
  • Less opinionated, which may lead to longer development time for consistent designs
  • Steeper learning curve for developers new to headless component concepts

Code Comparison

Headless UI (React):

import { Menu } from '@headlessui/react'

function MyDropdown() {
  return (
    <Menu>
      <Menu.Button>Options</Menu.Button>
      <Menu.Items>
        <Menu.Item>
          {({ active }) => (
            <a className={`${active && 'bg-blue-500'}`} href="/account">
              Account
            </a>
          )}
        </Menu.Item>
        {/* More items... */}
      </Menu.Items>
    </Menu>
  )
}

Tremor:

import { Dropdown, DropdownItem } from "@tremor/react";

function MyDropdown() {
  return (
    <Dropdown text="Options">
      <DropdownItem>Account</DropdownItem>
      {/* More items... */}
    </Dropdown>
  );
}

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.

Pros of Radix Primitives

  • Offers a wider range of unstyled, accessible UI components
  • Provides more granular control over component behavior and styling
  • Has a larger community and more frequent updates

Cons of Radix Primitives

  • Requires more setup and configuration to achieve a polished look
  • Less opinionated, which may lead to longer development times
  • Steeper learning curve for beginners

Code Comparison

Radix Primitives:

import * as Accordion from '@radix-ui/react-accordion';

<Accordion.Root type="single" collapsible>
  <Accordion.Item value="item-1">
    <Accordion.Trigger>Item 1</Accordion.Trigger>
    <Accordion.Content>Content 1</Accordion.Content>
  </Accordion.Item>
</Accordion.Root>

Tremor:

import { Accordion, AccordionBody, AccordionHeader, AccordionList } from "@tremor/react";

<Accordion>
  <AccordionHeader>Item 1</AccordionHeader>
  <AccordionBody>Content 1</AccordionBody>
</Accordion>

Summary

Radix Primitives offers more flexibility and control, making it suitable for complex, custom UI designs. Tremor, on the other hand, provides a more opinionated and streamlined approach, which can lead to faster development for standard use cases. The choice between the two depends on the specific project requirements and the development team's preferences.

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Pros of Material-UI

  • Extensive component library with a wide range of UI elements
  • Strong community support and regular updates
  • Highly customizable with theming capabilities

Cons of Material-UI

  • Steeper learning curve due to its comprehensive nature
  • Larger bundle size, which may impact initial load times
  • More opinionated design, which may require more effort to deviate from the Material Design style

Code Comparison

Material-UI:

import { Button, TextField } from '@mui/material';

<Button variant="contained" color="primary">
  Click me
</Button>
<TextField label="Enter text" variant="outlined" />

Tremor:

import { Button, TextInput } from '@tremor/react';

<Button size="xl" color="blue">
  Click me
</Button>
<TextInput placeholder="Enter text" />

Summary

Material-UI offers a more extensive component library and greater customization options, but comes with a steeper learning curve and larger bundle size. Tremor provides a simpler, more streamlined approach with a focus on data visualization components. The choice between the two depends on project requirements, design preferences, and the need for specific UI elements or data visualization tools.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README



Tremor Logo



DocumentationWebsite


React components to build charts and dashboards

Tremor NPM 20+ open-source components built on top of Tailwind CSS to make visualizing data simple again. Fully open-source, made by data scientists and software engineers with a sweet spot for design.


Tremor Banner


Getting Started

See our Installation Guide. To make use of the library we also need Tailwind CSS setup in the project.

Example

With Tremor creating an analytical interface is easy.

"use client";
import { AreaChart, Card } from "@tremor/react";

const chartdata = [
  {
    date: "Jan 23",
    "Route Requests": 289,
    "Station Requests": 233,
  },
  // ...
  {
    date: "Oct 23",
    "Route Requests": 283,
    "Station Requests": 247,
  },
];

export default function Example() {
  return (
    <Card className="max-w-4xl">
      <span className="text-tremor-default text-tremor-content dark:text-dark-tremor-content">
        Total Requests
      </span>
      <p className="text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong">
        6,568
      </p>
      <AreaChart
        className="mt-2 h-80"
        data={chartdata}
        index="date"
        categories={["Route Requests", "Station Requests"]}
        colors={["indigo", "rose"]}
        yAxisWidth={33}
      />
    </Card>
  );
}

Tremor Example

Community and Contribution

We are always looking for new ideas or other ways to improve Tremor NPM. If you have developed anything cool or found a bug, send us a pull request. Check out our Contributor License Agreement here.

License

Apache License 2.0

Copyright © 2024 Tremor Labs, Inc. All rights reserved.

NPM DownloadsLast 30 Days