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.




                @import url('')

  box-sizing border-box

  margin 0
  padding 0
  min-height 100vh
  display flex
  align-items center
  justify-content center
  font-family 'Lato', sans-serif
  background linear-gradient(28deg, #c5eff7, #fff)

  display grid
  background #fafafa
  grid-template-rows repeat(3, auto)
  grid-template-columns repeat(2, 1fr)
  grid-gap 2rem 0
  min-width 160px
  align-content center
  justify-content center
  align-items center
  justify-items center
  margin 0
  padding 2rem 1rem
  filter drop-shadow(20px 20px 20px #aaa)
  position relative

  grid-column 1 / -1
  margin 0
  font-size 1.25rem
  color #fff
  background #89c4f4
  position absolute
  width 248px
  padding 1rem
  z-index 3
  top 0
  left -1rem
  text-align center
  transform-origin top left
  transform rotate(-90deg) translate(-100%, -100%)

  cursor pointer

  display inline-block
  height 40px
  width 80px
  position relative
  overflow hidden
  border-radius 20px
  overflow hidden
  cursor pointer

    z-index 2
    opacity 0
    cursor pointer

    &:checked ~ .check__indicator
      background #7befb2

    &:checked ~ .check__indicator:after
      transform translate(40px, 0)

    height 100%
    width 100%
    position absolute
    top 0
    right 0
    bottom 0
    left 0
    margin 0

    background #ececec
    transition background .25s ease

      height 30px
      width 30px
      background #fff
      content ''
      position absolute
      border-radius 100%
      top 5px
      left 5px
      transition transform 0.25s ease



                const { React, ReactDOM, PropTypes } = window
const { Component, Fragment } = React
const { render } = ReactDOM
const rootNode = document.getElementById('app')

class MultiRadio extends Component {
  static defaultProps = {
    limit: 2,
    options: [
        label: 'Cheap',
        checked: false,
        label: 'Good',
        checked: false,
        label: 'Fast',
        checked: true,
  static propTypes = {
    options: PropTypes.array,
    limit: PropTypes.number,
  state = {
    options: this.props.options,
  onChange = e => {
    const invert =
      this.state.options.filter(o => o.checked && o.label !==
        .length === this.props.limit

      options: this.state.options.reduce(
        (arr, opt) => [
     === opt.label
                : invert
                  ? !opt.checked
                  : opt.checked,
  render = () => {
    return (
        <h1>Services on Offer</h1>
        { => (
          <Fragment key={`option--${o.label}`}>
            <label htmlFor={o.label}>{o.label}</label>
            <div className="check">
              <div className="check__indicator" />

render(<MultiRadio />, rootNode)