Changing the Viewer Theme
Our sample projects and report templates can help you learn the basics of working with our products.The viewer supports many visual themes, selected through options. This example applies a theme to the React viewer component.
Viewer setup. Configure the viewer, load the report, assign it to the component, and process the requests or events raised by the UI.
Viewer setup. Configure the viewer, load the report, assign it to the component, and process the requests or events raised by the UI.
import { Viewer, Stimulsoft } from 'stimulsoft-reports-js-react/viewer';
function App() {
var report = new Stimulsoft.Report.StiReport();
report.loadFile('Reports/SimpleList.mrt');
var viewerOptions = new Stimulsoft.Viewer.StiViewerOptions();
viewerOptions.appearance.theme = Stimulsoft.Viewer.StiViewerTheme.Office2022WhiteViolet;
viewerOptions.appearance.fullScreenMode = true;
return <Viewer options={viewerOptions} report={report} />;
}The theme comes from the StiViewerTheme enumeration; dozens of light and dark variants are available. Combined with fullScreenMode, the viewer matches the look of your React application.