📄 primereact/installation

File: installation.md | Updated: 11/15/2025

Source: https://primereact.org/installation/

Introducing PrimeReact v11 Alpha 🥁Learn More

Installation

PrimeReact is a rich set of open source UI components for React.

Download#


PrimeReact is available for download at npm .

// with npm
npm install primereact

// with yarn
yarn add primereact
         

Copy

Context#


Configuration is managed by the PrimeReactProvider and PrimeReactContext imported from primereact/api.

import { PrimeReactProvider, PrimeReactContext } from 'primereact/api';
         

Copy

The PrimeReactProvider component is used to wrap the application and the PrimeReactContext is used to access the configuration options.

// _app.js
import { PrimeReactProvider } from 'primereact/api';

export default function MyApp({ Component, pageProps }) {
    return (
        <PrimeReactProvider>
            <Component {...pageProps} />
        </PrimeReactProvider>
    );
}
         

Copy

Usage#


Each component can be imported individually so that you only bundle what you use. Import path is available in the documentation of the corresponding component.

Check

import { Button } from 'primereact/button';                             
         

Copy

Theming#


PrimeReact has two theming modes; styled or unstyled.

Styled Mode#

Styled mode is based on pre-skinned components with opinionated themes like Material, Bootstrap or PrimeOne themes. Theme is the required css file to be imported, visit the Themes section for the complete list of available themes to choose from.

import "primereact/resources/themes/lara-light-cyan/theme.css";
 

Copy

Unstyled Mode#

Unstyled mode is disabled by default for all components. Using the PrimeReactContext during installation, set unstyled as true to enable it globally. Visit the Unstyled mode documentation for more information and examples.

import { PrimeReactProvider } from "primereact/api";
...
return(
    <PrimeReactProvider value={{ unstyled: true }}>
        <App />
    </PrimeReactProvider>
)
 

Copy

Examples#


We've created various samples for the popular options in the React ecosystem.

Create React App Next.JS Vite Refine

Videos#


Video tutorials to take you through step-by-step.

Next.js#

PrimeReact has first class support for SSR and Next.JS , in fact this website is also built with Next.js

  • Download

  • Context

  • Usage

  • Theming

    • Styled Mode

    • Unstyled Mode

  • Examples

  • Videos

    • Next.js

PrimeReact 10.9.7 by PrimeTek