1.0.1 • Published 3 years ago

codepen-react v1.0.1

Weekly downloads
43
License
MIT
Repository
github
Last release
3 years ago

<CodePen />

A react component to embed codepen

English | 简体中文

Getting Started

# NPM
$ npm install codepen-react -S

# Yarn
$ yarn add codepen-react

Usage

import React from 'react'
import CodePen from 'codepen-react'

export default class CodeBox extends React.Component {
  render() {
    return (
      <CodePen
        user="leedom92"
        hash="gOLvgRe"
      />
    )
  }
}

Options

PropertyTypeArgumentValuesDefaultDescription
typestring<optional>iframe, embediframethe type of the codepen.
userstring<required>nullcodepen username.
hashstring<required>nullthe hash id of the pen to display.
widthstring<optional>'', %100%the width of the pen.
heightstring<optional>'', %400the height of the pen.
titlestring<optional>''the title of the pen.
themestring<optional>light, darklightthe theme the pen should use.
editablebool<optional>true, falsetruethe editable of the pen.
previewbool<optional>true, falsefalsethe preview of the pen. u must run pen manually.
tabstring<optional>html, css, js, resultresultthe default tab that should be displayed.

License

Copyright (c) 2021 Leedom
Licensed under the MIT license.

1.0.1

3 years ago

1.0.0

3 years ago