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="app"></div>


                @import url('')

$default: #fff
$primary: #00b2d0
$secondary: #00c92b
$alert: #e53d00

    background: $color
      background: $color*.9
      box-shadow: 1px 1px 1px #333

  width: 90%
  margin: 0 auto
  display: flex
  flex-direction: column
  justify-content: center
  font-family: 'Lato', sans-serif
  margin: 0.5em
  padding: .5em 1.5em
  border: 1px solid #000
  color: #fff
  border-radius: 4px
  cursor: pointer
  transition: background .20s ease-in, box-shadow .20s ease-in
  text-transform: uppercase
    color: #000
    border-radius: 50%
    padding: 1em
    opacity: .3
    cursor: initial
      box-shadow: none
    box-shadow: inset 1px 1px 1px #333    
    outline: none

  display: flex
  flex-direction: column
  justify-items: center
    text-align: center
  display: grid
  justify-items: center
  width: 100%
    grid-template-columns: repeat(3,1fr)
    grid-template-columns: repeat(4,1fr)


                class Button extends React.Component {
  static propTypes = {
    children: PropTypes.node.isRequired,
    color: PropTypes.string,

  render() {
    const {children,color,disable, round} = this.props
    const btnColorClass = (color ) ? `button--${color}` : 'button--default'
    const disabledClass = (disable) ? 'button--disabled' : ''
    const roundClass = (round) ? 'button--round' :  ''
    const btnClasses = `${btnColorClass} ${disabledClass} ${roundClass}`
    return (
      <button className={`button ${btnClasses}`} disabled={disable}>

const BtnContainer = ({title,colClass,children}) => {
    <div className='buttons-container'>
      <div className={`buttons-wrapper  ${colClass}`}>

class App extends React.Component {

  render() {
    return (
      <div className="app">
        <BtnContainer title='Default Color Buttons' colClass='four-cols'>
          <Button color='primary' > Primary </Button>
          <Button color='secondary' > Secondary </Button>
          <Button color='alert' > Alert </Button>
          <Button disable>Ciao</Button>
          <Button color='primary' disable> Primary </Button>
          <Button color='secondary' disable> Secondary </Button>
          <Button color='alert' disable> Alert </Button>
        <BtnContainer title='Round Buttons' colClass='three-cols'>
          <Button color='primary' round > + </Button>
          <Button color='secondary' round > = </Button>
          <Button color='alert' round > - </Button>
          <Button color='primary' round disable> + </Button>
          <Button color='secondary' round disable> = </Button>
          <Button color='alert' round disable> - </Button>