GS1 Barcodes in React Barcode component

GS1 standards define a series of barcodes used for supply chain management, retail, and logistics operations. These barcodes encode product identification and tracking data using standardized GS1 Application Identifiers (AIs). The EJ2 Barcode Generator supports multiple GS1 barcode types to meet various industry requirements.

GS1-Code128 Barcode

GS1-Code128 is a linear barcode based on Code 128 that uses GS1 Application Identifiers (AIs) to encode structured business data. It is commonly used in retail, logistics, health care, and supply-chain applications to store information such as product identifiers, batch numbers, expiration dates, and serial numbers.

Allowed Input Characters: GS1-128 supports numeric values (0-9), uppercase and lowercase alphabetic characters (A-Z, a-z), and supported ASCII special characters. Data should be encoded using valid GS1 Application Identifiers (AIs) to represent structured business information.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1-Code128 barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="300px"
    height="200px"
    type="GS1Code128"
    value="(01)09506000134352(17)261231(10)ABC123"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1-Code128 barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="300px"
    height="200px"
    type="GS1Code128"
    value="(01)09506000134352(17)261231(10)ABC123"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 40px;
            width: 300pxpx;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>

GS1 Barcode Generator

GS1-128 accepts GS1 Application Identifier (AI) data. The AI is enclosed in parentheses, followed by the data. Multiple AIs can be concatenated together.

Common GS1 Application Identifiers

AI Description
00 Serial Shipping Container Code (SSCC)
01 Global Trade Item Number (GTIN)
10 Batch or Lot Number
11 Production Date
15 Best Before Date
17 Expiration Date
21 Serial Number
240 Additional Product Identification
400 Customer Purchase Order Number

ITF-14 Barcode

ITF-14 (Interleaved 2 of 5) is the GS1 standard for encoding 14-digit Global Trade Item Numbers (GTINs) on outer cases and shipping cartons. The barcode automatically calculates and adds the GS1 mod-10 check digit. It is commonly used in logistics and warehouse management for tracking product cases.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create ITF-14 barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="300px"
    height="150px"
    type="ITF14"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create ITF-14 barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="300px"
    height="150px"
    type="ITF14"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 150px;
            width: 300pxpx;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>

GS1 ITF 14 Barcode Generator

Allowed Input Characters: ITF-14 supports numeric values (0-9) only and is used to encode a 14-digit GTIN (Global Trade Item Number). The final digit is automatically calculated as a check digit.

GS1 DataBar Barcodes

GS1 DataBar is a family of linear barcode symbols designed for encoding GTIN data in retail and health care applications. These symbols provide a compact alternative to traditional linear barcodes while supporting reliable scanning and product identification.

GS1 DataBar Omnidirectional

The GS1 DataBar Omnidirectional is a single-row barcode used to encode a 14-digit GTIN for retail product identification. It supports omnidirectional scanning, allowing the barcode to be read from any direction at the point of sale, making it suitable for consumer products and retail environments.

Allowed Input Characters: The GS1 DataBar Omnidirectional barcode encodes a 14-digit GS1 identification number designed for omnidirectional scanning. Accepted input includes numeric values (0-9) only, suitable for retail point-of-sale systems requiring multi-angle scanning capability.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Omnidirectional barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="300px"
    height="200px"
    type="GS1DataBarOmnidirectional"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Omnidirectional barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="300px"
    height="200px"
    type="GS1DataBarOmnidirectional"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 200px;
            width: 300pxpx;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>

GS1 Databar OmniDirectional Barcode Generator

GS1 DataBar Stacked

The GS1 DataBar Stacked is a compact linear barcode that encodes a 14-digit Global Trade Item Number (GTIN) in a two-row stacked format. It is designed for retail and consumer products where label space is limited, providing efficient product identification while maintaining compatibility with point-of-sale systems. The stacked layout reduces the barcode width, making it suitable for small packages and labels.

Allowed Input Characters: GS1 DataBar Stacked supports numeric values (0-9) only and is used to encode a 14-digit GTIN (Global Trade Item Number). Its stacked format is designed for applications where horizontal space is limited while maintaining reliable scanning performance.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Stacked barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="350px"
    height="200px"
    type="GS1DataBarStacked"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Stacked barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="350px"
    height="200px"
    type="GS1DataBarStacked"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 200px;
            width: 350pxpx;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>

GS1 Databar OmniDirectional Stacked Barcode Generator

GS1 DataBar Stacked Omnidirectional

The GS1 DataBar Stacked Omnidirectional is a two-row variant of the DataBar Omnidirectional. It provides omnidirectional scanning capability in a more compact vertical footprint, useful for items where horizontal space is limited.

Allowed Input Characters: GS1 DataBar Stacked Omnidirectional supports numeric values (0-9) only and is used to encode a 14-digit GTIN (Global Trade Item Number). It combines a compact stacked layout with omnidirectional scanning capabilities for retail environments where space is limited.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Stacked Omnidirectional barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="350px"
    height="200px"
    type="GS1DataBarStackedOmnidirectional"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Stacked Omnidirectional barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="350px"
    height="200px"
    type="GS1DataBarStackedOmnidirectional"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 200px;
            width: 350pxpx;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>

GS1 Databar Stacked OmniDirectional Barcode Generator

GS1 DataBar Limited

The GS1 DataBar Limited barcode is a reduced-width symbol designed for small trade items where full-size EAN/UPC symbols cannot fit. It has the narrowest width among DataBar symbols, making it ideal for compact labeling applications.

Allowed Input Characters: GS1 DataBar Limited supports numeric values (0-9) only and is used to encode a 14-digit GTIN (Global Trade Item Number). It is designed for applications where space is limited while maintaining accurate product identification.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Limited barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="200px"
    height="100px"
    type="GS1DataBarLimited"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Limited barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="200px"
    height="100px"
    type="GS1DataBarLimited"
    value="12345678901231"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 100px;
            width: 200pxpx;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>

GS1 Databar Limited Barcode Generator

Note: GS1 DataBar Limited has restrictions on valid GTIN values. The check digit must be in the range of 0-4 for restricted items.

GS1 DataBar Expanded

The GS1 DataBar Expanded barcode supports multiple GS1 Application Identifiers (AIs), making it suitable for variable-measure products, coupons, and other applications that require additional data beyond a GTIN. It can encode up to 74 numeric or 41 alphanumeric characters.

Allowed Input Characters: GS1 DataBar Expanded supports GS1 Application Identifiers (AIs) and can encode numeric, alphanumeric, and supported special characters. It can store up to 74 numeric digits or 41 alphanumeric characters, enabling the encoding of detailed GS1-compliant data.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Expanded barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="400px"
    height="100px"
    type="GS1DataBarExpanded"
    value="(01)09506000134352(17)271231(10)LOT12345(21)SN987654321"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Expanded barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="400px"
    height="100px"
    type="GS1DataBarExpanded"
    value="(01)09506000134352(17)271231(10)LOT12345(21)SN987654321"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 100px;
            width: 400pxpx;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>

GS1 Databar Expanded Barcode Generator

GS1 DataBar Expanded Stacked

The GS1 DataBar Expanded Stacked is a multi-row variant of the GS1 DataBar Expanded. It provides the same multi-AI encoding capability while reducing horizontal space requirements by stacking multiple rows.

Allowed Input Characters: The GS1 DataBar Expanded Stacked barcode supports GS1 application identifiers (AIs) with alphanumeric data. It can encode up to 74 digits of numeric data or 41 characters of alphanumeric data with special characters for data separation using GS1 compliance standards.

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Expanded Stacked barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="400px"
    height="300px"
    type="GS1DataBarExpandedStacked"
    value="(01)09506000134352(17)271231(10)LOT12345"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create GS1 DataBar Expanded Stacked barcode
ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="400px"
    height="300px"
    type="GS1DataBarExpandedStacked"
    value="(01)09506000134352(17)271231(10)LOT12345"
    displayText=
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 300px;
            width: 400pxpx;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>

GS1 Databar Expanded Stacked Barcode Generator

GS1 DataBar Validation

The GS1 barcode components include built-in validation to ensure data integrity. Invalid input will trigger the invalid event:

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// GS1-Code128 barcode with validation handler
const handleInvalid = (args) => {
  console.log('Barcode validation error: ' + args.message);
};

ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="300px"
    height="150px"
    type="GS1Code128"
    value="(01)12345678901234"
    invalid={handleInvalid}
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// GS1-Code128 barcode with validation handler
const handleInvalid = (args) => {
  console.log('Barcode validation error: ' + args.message);
};

ReactDOM.render(
  <BarcodeGeneratorComponent
    id="barcode"
    width="300px"
    height="150px"
    type="GS1Code128"
    value="(01)12345678901234"
    invalid={handleInvalid}
  ></BarcodeGeneratorComponent>,
  document.getElementById("barcode")
);
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 150px;
            width: 300pxpx;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>

Dynamic Property Updates

The GS1 Barcode components support real-time property binding. When you change any property value, the barcode automatically updates to reflect the changes. This is useful for creating interactive applications where users can customize the barcode appearance dynamically.

Update GS1 Barcode Properties Dynamically

Here is an example showing how to dynamically update GS1 Barcode properties using event handlers:

import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create a GS1 barcode that can be updated dynamically
const App = () => {
  const [barcodeType, setBarcodeType] = React.useState('GS1Code128');
  const [value, setValue] = React.useState('(01)09506000134352');
  const [foreColor, setForeColor] = React.useState('black');
  const [backgroundColor, setBackgroundColor] = React.useState('white');
  
  return (
    <div style=>
      <div style=>
        <label style=>Barcode Type: </label>
        <input 
          type="text" 
          value={barcodeType} 
          onChange={(e) => setBarcodeType(e.target.value)}
          placeholder="Enter barcode type"
          style=
        />
      </div>
      <div style=>
        <label style=>Value: </label>
        <input 
          type="text" 
          value={value} 
          onChange={(e) => setValue(e.target.value)}
          placeholder="Enter value"
          style=
        />
      </div>
      <div style=>
        <label style=>Fore Color: </label>
        <input 
          type="text" 
          value={foreColor} 
          onChange={(e) => setForeColor(e.target.value)}
          placeholder="Enter color"
          style=
        />
      </div>
      <div style=>
        <label style=>Background Color: </label>
        <input 
          type="text" 
          value={backgroundColor} 
          onChange={(e) => setBackgroundColor(e.target.value)}
          placeholder="Enter color"
          style=
        />
      </div>
      <BarcodeGeneratorComponent
        id="barcode"
        width="300px"
        height="150px"
        type={barcodeType}
        value={value}
        foreColor={foreColor}
        backgroundColor={backgroundColor}
        displayText=
      ></BarcodeGeneratorComponent>
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById("barcode"));
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-react-barcode-generator';

// Create a GS1 barcode that can be updated dynamically
const App = () => {
  const [barcodeType, setBarcodeType] = React.useState('GS1Code128');
  const [value, setValue] = React.useState('(01)09506000134352');
  const [foreColor, setForeColor] = React.useState('black');
  const [backgroundColor, setBackgroundColor] = React.useState('white');
  
  return (
    <div style=>
      <div style=>
        <label style=>Barcode Type: </label>
        <input 
          type="text" 
          value={barcodeType} 
          onChange={(e) => setBarcodeType(e.target.value)}
          placeholder="Enter barcode type"
          style=
        />
      </div>
      <div style=>
        <label style=>Value: </label>
        <input 
          type="text" 
          value={value} 
          onChange={(e) => setValue(e.target.value)}
          placeholder="Enter value"
          style=
        />
      </div>
      <div style=>
        <label style=>Fore Color: </label>
        <input 
          type="text" 
          value={foreColor} 
          onChange={(e) => setForeColor(e.target.value)}
          placeholder="Enter color"
          style=
        />
      </div>
      <div style=>
        <label style=>Background Color: </label>
        <input 
          type="text" 
          value={backgroundColor} 
          onChange={(e) => setBackgroundColor(e.target.value)}
          placeholder="Enter color"
          style=
        />
      </div>
      <BarcodeGeneratorComponent
        id="barcode"
        width="300px"
        height="150px"
        type={barcodeType}
        value={value}
        foreColor={foreColor}
        backgroundColor={backgroundColor}
        displayText=
      ></BarcodeGeneratorComponent>
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById("barcode"));
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Barcode</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="React UI Controls" />
    <meta name="author" content="Syncfusion" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
    <style>
        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;
        }
        .barcodeStyle{
            height: 150px;
            width: 300px;
            padding-left: 40%;
            padding-top: 9%;
        }
    </style>
</head>

<body>
    <div id='barcode' class="barcodeStyle">
        <div id='loader'>Loading....</div>
    </div>
</body>

</html>