css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm 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. We'll also process your JavaScript with Babel.

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

Code Indentation


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.

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.

              @import url('https://fonts.googleapis.com/css?family=Lato')

  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 !== e.target.id)
        .length === this.props.limit

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

render(<MultiRadio />, rootNode)

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................