Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!-- Include React & DataGridXL -->
<script src="" crossorigin></script>
<script src="" crossorigin></script>
<script src=""></script>

<h2>DataGridXL and React</h2>
<h3>Edit cell value(s) to see "data" change</h3>

<div id="app"></div>


                body {
  font-family: sans-serif;

#grid {
  height: 400px;


                // shorthand function to create React elements
var e = React.createElement;


class DataGrid
(wrapper for DataGridXL)


// create a component (wrapper) for DataGridXL
// we name it "DataGrid" since "DataGridXL" already exists.
class DataGrid extends React.Component {

  constructor(props) {


    // create the Data Grid
    var grid = new DataGridXL("grid");
    // save component scope in `self` so we can change our props.
    var self = this;

    // fire the `onChange` property when data changes"cellvaluechange", function(ev){, ev);
    });"documentchange", function(ev){, ev);
    });"ready", function(ev){, ev);


    // tell React to not update the DOM for this component
    // DataGridXL fully takes care of this
    return false;

  render() {

    return e(
      'div', {
        id: 'grid'



class App


class App extends React.Component {



    this.state = {
      data: null
    // save App component as window var
    // so we can setState in our handleOnChange method
    window.myApp = this;



      data: JSON.stringify(this.getData())


    return e('div', {}, 
      e(DataGrid, {
        onChange: this.handleOnChange
      e('div', {}, 'data '


// render our App component inside div#app
ReactDOM.render(e(App), document.getElementById("app"));