Socket
Socket
Sign inDemoInstall

primereact

Package Overview
Dependencies
Maintainers
4
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

primereact

PrimeReact is an open source UI library for React featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with Prime


Version published
Weekly downloads
176K
increased by2.01%
Maintainers
4
Weekly downloads
 
Created

What is primereact?

PrimeReact is a comprehensive collection of rich UI components for React. It provides a wide range of components that are designed to be highly customizable and easy to use, making it suitable for building modern, responsive web applications.

What are primereact's main functionalities?

DataTable

The DataTable component is used to display data in a tabular format. It supports features like sorting, filtering, and pagination.

import React from 'react';
import { DataTable } from 'primereact/datatable';
import { Column } from 'primereact/column';

const MyDataTable = () => {
  const data = [
    { id: 1, name: 'John', age: 30 },
    { id: 2, name: 'Jane', age: 25 }
  ];

  return (
    <DataTable value={data}>
      <Column field="id" header="ID" />
      <Column field="name" header="Name" />
      <Column field="age" header="Age" />
    </DataTable>
  );
};

export default MyDataTable;

Dialog

The Dialog component is used to display content in a modal window. It can be customized with headers, footers, and various other options.

import React, { useState } from 'react';
import { Dialog } from 'primereact/dialog';
import { Button } from 'primereact/button';

const MyDialog = () => {
  const [visible, setVisible] = useState(false);

  return (
    <div>
      <Button label="Show" icon="pi pi-external-link" onClick={() => setVisible(true)} />
      <Dialog header="Header" visible={visible} style={{ width: '50vw' }} onHide={() => setVisible(false)}>
        <p>Content</p>
      </Dialog>
    </div>
  );
};

export default MyDialog;

Chart

The Chart component is used to create various types of charts, such as bar, line, and pie charts. It is built on top of the popular Chart.js library.

import React from 'react';
import { Chart } from 'primereact/chart';

const MyChart = () => {
  const data = {
    labels: ['January', 'February', 'March', 'April', 'May'],
    datasets: [
      {
        label: 'My First dataset',
        backgroundColor: '#42A5F5',
        borderColor: '#1E88E5',
        data: [65, 59, 80, 81, 56]
      }
    ]
  };

  return <Chart type="bar" data={data} />;
};

export default MyChart;

Other packages similar to primereact

Keywords

FAQs

Package last updated on 29 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc