Universal Data Tool
  • Universal Data Tool Docs
  • Installation
  • Running On-Premise
  • Collaborative Labeling
  • Building and Labeling Datasets
    • Image Segmentation
    • Image Classification
    • Text Classification
    • Named Entity Recognition
    • Entity Relations / Part of Speech Tagging
    • Audio Transcription
    • Data Entry
    • Video Segmentation
    • Composite Interfaces
    • Landmark / Pose Annotation
  • Importing Data
    • Upload or Open Directories
    • Import File URLs
    • Import COCO Images
    • Import from Google Drive
    • Import from AWS S3 Bucket
    • Import from CSV or JSON
    • Import using AWS Cognito
    • Import Text Snippets
  • The Format .udt.json
    • What is the .udt.json format?
    • What is the .udt.csv format?
  • Machine Learning
    • Jupyter Notebook Integration
    • Import Datasets into Pandas
    • Fast.ai
      • Fast.ai Image Classification
      • Fast.ai Image Segmentation
  • Integrate with Any Web Page
    • Integrate with the Javascript Library
    • Getting Started with React
  • Train your Workforce
    • Getting Started with UDT Courses
  • Frequently Asked Questions
Powered by GitBook
On this page
  • Quick Start: CodeSandbox Example
  • Installation
  • Usage

Was this helpful?

  1. Integrate with Any Web Page

Getting Started with React

Use the Universal Data Tool in React Applications.

PreviousIntegrate with the Javascript LibraryNextGetting Started with UDT Courses

Last updated 4 years ago

Was this helpful?

Quick Start: CodeSandbox Example

Installation

npm install universal-data-tool

Usage

The <UniversalDataViewer /> component has every interface baked in. Just provide a dataset in the dataset prop to view any dataset!

import React from "react";
import UniversalSampleEditor from "universal-data-tool";

export default function App() {
  return (
    <div className="App">
      <UniversalSampleEditor
        // Read more about this format here:
        // https://github.com/UniversalDataTool/udt-format
        interface={{
          type: "image_classification",
          labels: ["cat", "dog"]
        }}
        sample={{
          imageUrl: "https://placekitten.com/408/287"
        }}
        onExit={(action: "go-to-prev" | "go-to-next" | undefined) => {
          // Called when user hits "Save", "Next", or "Prev"
        }}
        // when data is saved this is called
        onModifySample={(sampleIndex, newSampleData) => {
          // do something
        }}
      />
    </div>
  );
}
Example Loading Image Classification Interface