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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.


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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              const Modal = props => (
  <div id="modal1" className="modal">
    <div className="modal-content">
      <div id="row">
          <div className="input-field col s12">
            <input id="recipe_name" type="text" className="validate" />
            <label for="recipe_name">Recipe Name:</label>
        <div className="row">
          <div className="input-field col s12">
            <input id="ingredients" type="text" placeholder="Enter Ingredients,Separated,By Commas" />
            <label for="ingredients">Ingredients:</label>
    <div className="modal-footer">
      <a href="#" className="modal-action modal-close waves-effect waves-green btn-flat" onClick={props.addRecipe}>Add Recipe</a>
      <a href="#" className="modal-action modal-close waves-effect waves-green btn-flat">Close</a>

const Items = props => (
  <div className="col offset-l2 l8 s12">
    <ul className="collapsible blue-grey-text">
      { =>
        <div className="collapsible-header blue-grey lighten-5">{}</div>
        <div className="collapsible-body blue-grey lighten-5">

          <div className="collection with-header">
            <li className="collection-header blue-grey lighten-4"><h4>Ingredients</h4></li>
              // =>
                <li className="collection-item blue-grey lighten-4">{ e => <p>{e}</p> )}</li>
          <p className="row">
            <div className="col s4 offset-s2 center">
              <a href="#" className="btn waves-effect waves-light red modal-trigger"><i className="material-icons left">delete</i>Delete</a>  
            <div className="col s4 center">
              <a data-target="modal1" href="#" className="btn waves-effect waves-light blue darken-4 modal-trigger"><i className="material-icons left">edit</i>Edit</a>


class RecipeBox extends React.Component{

    //this.recipeName = React.createRef();
    //this.recipeIngredients = React.createRef();    
    this.state = {
          name: "Pumpkin Pie",
          ingredients: ["Pumpkin Puree","Sweetened Condensed Milk","Eggs","Pumpkin Pie Spice","Pie Crust"]
          name: "Spaghetti",
          ingredients: ["Noodles","Tomato Sauce","(Optional) Meatballs"]
          name: "Onion Pie",
          ingredients: ["Onion","Pie Crust","Sounds Yummy right?"]
    this.addRecipe = this.addRecipe.bind(this);
  componentDidMount() {   
      //initialize all modals           
      $(document).ready(function() {
    //console.log({name: recipe_name.value, ingredients: ingredients.value.split(',')});
    const newItem = {name: recipe_name.value, ingredients: ingredients.value.split(',')};
    const recipes = {, newItem};
  render() {
      <div className="container">
        <h1 className="center-align blue-text text-darken-4">Recipes</h1>
        <div className="row">
          <Items recipes={} />
        <div className="row">
          <div className="col offset-s2 s8">
            <a data-target="modal1" className="waves-effect waves-light btn-large blue darken-4 modal-trigger" onClick={this.addRecipe}><i className="material-icons left">add</i>Add Recipe</a>  
        <Modal addRecipe={this.addRecipe} />

  <RecipeBox />,