Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <h3>Registration form<h3>
<div class="app"></div>
              
            
!

CSS

              
                body 
  background-color: #2f2f31

h3
  text-align: center
  color: #ddd

section
  border: 5px solid rgba(255, 255, 255, .3)
  display: block
  margin: 50px auto
  width: 300px
  height: auto
  padding: 10px
  border-radius: 6px
  box-shadow: 0px 0px 300px 1px #333

form
  padding: 40px 30px
  background-color: rgba(255, 255, 255, .1)
  border-radius: 4px
  span
    display: block
    text-align: left
    font-size: 13px
    font-weight: normal
    margin: 5px
    color: #999
  input
    padding: 9px 10px
    width: 90%
    display: inline-block
    margin-bottom: 15px
    border-radius: 4px
    border: none
    background-color: #2f2f31
    color: #ddd
  button
    margin: 20px auto
    display: block
    padding: 10px 30px
    border: 1px solid #333
    border-radius: 4px
    background-color: #ddd
    color: #333
    font-size: 17px
    &:hover
      cursor: pointer
  
              
            
!

JS

              
                const { Component } = React;

class RegistrationForm extends Component {
  componentDidMount() {
    ReactDOM.findDOMNode(this.refs.name).focus();
  }
  
  handleSubmit(event) {
    const { name, email, password } = this.refs;
    
    const user = {
      name: ReactDOM.findDOMNode(name).value,
      email: ReactDOM.findDOMNode(email).value,
      password: ReactDOM.findDOMNode(password).value,
    }
    
    console.log(user);
    event.preventDefault();
  }

  render() {
    return (
      <section>
        <form onSubmit={ () => this.handleSubmit() }>
          <label>
            <span>name</span>
            <input  type="text"
                    ref="name"
                    defaultValue=""
                    placeholder="name"
                    required />
          </label>
          <label>
            <span>email</span>
            <input  type="email"
                    ref="email"
                    defaultValue="" 
                    placeholder="@email"
                    required />
          </label>
          <label>
            <span>password</span>
            <input  type="password"
                    ref="password"
                    defaultValue=""
                    required />
          </label>
          <button>submit</button>
        </form>
      </section>
    );
  }
}

ReactDOM.render(
  <RegistrationForm />,
  document.querySelector('.app'));

              
            
!
999px

Console