Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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.


Auto Save

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.


                <div id="root"></div>


  font-family: Montserrat;
    border: 1px solid red;
    color: red
    background: #0099F7;  /* fallback for old browsers */
    background: -webkit-linear-gradient(to right, #F11712, #0099F7);  /* Chrome 10-25, Safari 5.1-6 */
    background: linear-gradient(to right, #F11712, #0099F7); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
    border-radius: 250px;
    border-top: 1px solid #CCC;
    box-shadow: 0px 0px 5px 0px #CCC;
    cursor: pointer;
    vertical-align: middle;
    width: 250px;
    margin: 0 auto;
    padding: 15px;
      text-align: center
      text-align: center


//Class should only be be used in ES6
//Alternative is to use function

 * A simple React component
class ReactClock extends React.Component {
  constructor(props) {
    this.state = {date : new Date(), 
                  label: 'ReactJS Clock', 
                  css  : 'empty'};
    // This binding is necessary to make `this` work in the callback
    this.handleClick = this.handleClick.bind(this);
  //Lifecycle hooks
  componentDidMount() {
    this.timerID = setInterval(
      () => this.tick(),
  componentWillUnmount() {
  tick() {
      date: new Date()
      label: 'Clicked!',
      css  : 'clickedclock'
    this.setState(prevState => ({
      css: (prevState.css=='clickedclock')?'':'clickedclock'
  render() {
    return (
            <div id="clockwrapper" className={this.state.css} onClick={this.handleClick}>

/*function animateClock(){
  document.getElementById('clockwrapper').className = 'clocktick';

//Render only one ReactButton component
function tickTheClock(){
  //Render clock
  React.render(<ReactClock/>, document.getElementById('root'));
  //Render animation

//setInterval(tickTheClock, 1000);

  React.render(<ReactClock/>, document.getElementById('root'));