New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@reportwright/react

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reportwright/react

The ReportWright report viewer and designer as React components.

Source
npmnpm
Version
0.13.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@reportwright/react

npm license Socket

The ReportWright viewer and designer as React components. React is a peer dependency; the viewer loads on mount, so it is safe in server-rendered apps (Next.js, Remix).

import { ReportWrightViewer, ReportWrightDesigner } from '@reportwright/react';

<ReportWrightViewer definition={def} data={{ orders }} fontsUrl="/pw/fonts/" style={{ height: 720 }} />   {/* no server */}
<ReportWrightViewer server="https://reports.example.com" report="invoice" params={{ id: '42' }} style={{ height: 720 }} />
<ReportWrightDesigner server="https://reports.example.com" definition={def} onSave={(d) => save(d)} toolbox={{ hide: ['map'] }} />

Props are the options of mountViewer / mountDesigner (see @reportwright/viewer), plus className, style and onReady(handle). A ref gets the same ViewerHandle as onReady (setParameters, goToPage, export, on, …; see @reportwright/viewer), so const viewer = useRef(null) … <ReportWrightViewer ref={viewer} … /> then viewer.current?.setParameters({ id: '7' }). The viewer remounts when what it shows changes (compared by content, so inline objects are fine); the designer only for another report or a definition with different content, so it keeps its edits. If the viewer's code fails to load, the element shows the error and onError(error) is called. MIT.

No server needed: pass definition, data (JSON by data source name) and fontsUrl (a copy of @reportwright/fonts/public/fonts). server (the self-hosted ReportWright server) is optional: see what works standalone.

Keywords

reportwright

FAQs

Package last updated on 08 Oct 2026

Related posts