Skip to main content
torch.js has not been released yet.
torch.js logotorch.js logotorch.js
PlaygroundContact
Login
Documentation
IntroductionType SafetyTensor ExpressionsTensor IndexingEinsumEinopsAutogradTraining a ModelProfiling & MemoryPyTorch MigrationBest PracticesRuntimesPerformancePyTorch CompatibilityBenchmarksDType Coverage
IntroductionComponent GalleryTraining DashboardsVisualizing TensorsGPU AccelerationInteractive InputsThemingStorybook
torch.js· 2026
LegalTerms of UsePrivacy Policy
  1. docs
  2. React UI
  3. Introduction

React UI

The @torchjsorg/react-ui package provides a rich set of React components designed specifically for building interactive machine learning applications. From real-time training dashboards to advanced 3D embedding viewers, these components bridge the gap between low-level tensor operations and user-facing interfaces.

Showcase of various torch.js React components

Want to see all 50+ components? Browse the Component Gallery to see live previews of every component, or explore the interactive Storybook for full documentation and code examples.

Core Philosophy

Most react-ui components are designed to work directly with torch.js tensors. A significant portion of the library is WebGPU-native, meaning data can flow from your model to the screen without ever leaving GPU memory, enabling 60fps visualizations of massive datasets.

Installation

npm install @torchjsorg/torch.js @torchjsorg/react-ui
# or
pnpm add @torchjsorg/torch.js @torchjsorg/react-ui

Quick Start

Visualizing a tensor is as simple as passing it to the TensorViewer component.

import { TensorViewer } from '@torchjsorg/react-ui';
import torch from '@torchjsorg/torch.js';

function App() {
  const data = torch.randn([16, 16]);

  return (
    <div className="h-64 w-64">
      <TensorViewer data={data} colorScale="viridis" />
    </div>
  );
}

Component Categories

CategoryKey ComponentsBest For
TrainingGPUStreamingChart, TrainingControlsReal-time monitoring
VisualizationTensorViewer, AttentionViewerModel interpretability
InputImageInput, ImageEditor, TextInputData collection & editing
AnalysisConfusionMatrix, ROCPRCurveModel evaluation

GPU-Accelerated Components

Components prefixed with GPU (e.g., GPUHeatmap, GPUPointCloud) utilize the high-performance @torchjsorg/viz backend. These components are designed for high-frequency updates and large-scale data.

Zero-Copy Rendering: GPU components can render tensors directly from WebGPU buffers. This avoids the expensive GPU-to-CPU readback stall, which is crucial for maintaining performance during active training.

Component Gallery

See all components at a glance with live previews:

Browse the Component Gallery

Storybook

We maintain an interactive Storybook containing live demos and code snippets for every component in the library.

Browse all components at ui.torchjs.org

Next Steps

  • Component Gallery - Browse all components with live previews.
  • Training Dashboards - Build real-time monitoring tools.
  • Visualizing Tensors - Deep dive into interpretability components.
  • GPU Acceleration - Understanding zero-copy rendering.
  • Theming - Customizing the look and feel.
Next
Component Gallery