JSFiddle - React, Tailwind, and code Playground

by Flexmonster Pivot Table

HTML

<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div id="pivot-container"></div>

CSS

.fm-grid-view .fm-cell,
.fm-data-sheet {
  border: 0px !important;
}

JavaScript

/* Set as true to enable designer mode */
let isAuthorized = false;

var pivot = new Flexmonster({
  container: "#pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: isAuthorized,
  report: {
    dataSource: {
      type: "json",
      data: getData()
    },
    "slice": {
      "rows": [{
        "uniqueName": "Category"
      }, {
        "uniqueName": "Color"
      }],
      "columns": [{
        "uniqueName": "[Measures]"
      }],
      "measures": [{
        "uniqueName": "Quantity",
        "aggregation": "sum"
      }]
    },
    options: {
      configuratorActive: false,
      grid: {
        showHeaders: false
      }
    }
  },
  width: "100%",
  height: 450
});

selectMode(isAuthorized);

function selectMode(auth) {
  if (isAuthorized) interactive();
  else readOnly();
}


function readOnly() {
  pivot.setOptions({
    readOnly: true
  });
  toggleToolbar(true);
  pivot.refresh();
}

function interactive() {
  pivot.setOptions({
    readOnly: false
  });
  toggleToolbar(false);
  pivot.refresh();
}

function getData() {
  return [{
    "Category": "Accessories",
    "Size": "262 oz",
    "Color": "red",
    "Destination": "Australia",
    "Business Type": "Specialty Bike Shop",
    "Country": "Australia",
    "Price": 174,
    "Quantity": 225,
    "Discount": 23
  }, {
    "Category": "Accessories",
    "Size": "214 oz",
    "Color": "yellow",
    "Destination": "Canada",
    "Business Type": "Specialty Bike Shop",
    "Country": "Canada",
    "Price": 502,
    "Quantity": 90,
    "Discount": 17
  }, {
    "Category": "Components",
    "Size": "235 oz",
    "Color": "green",
    "Destination": "Australia",
    "Business Type": "Warehouse",
    "Country": "Australia",
    "Price": 551,
    "Quantity": 1950,
    "Discount": 51
  }, {
    "Category": "Components",
    "Size": "307 oz",
    "Color": "white",
    "Destination": "United Kingdom",
    "Business Type": "Warehouse",
    "Country": "Canada",
    "Price": 842,
   ...