npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-codepen-prefill

v0.3.0

Published

React component to create a button/link to prefill codepen.io with supplied code

Downloads

25

Readme

react-codepen-prefill

React component to create a button/link to prefill Codepen.io with supplied code.

Installation

npm install --save react-codepen-prefill

Usage

import React from 'react';
import CodepenPrefill from 'react-codepen-prefill';

...

  <CodepenPrefill
    label="Hello World"
    className="simple-link"
    target="_blank"
    title="CodepenPrefill Example"
    description="An example of the CodepenPrefill Component in action."
    js="console.log('hello world')"
    css="body{color: blue;}"
    html="<h1>Hello World</h1>"
    editors="111"
  />

For more examples: https://ronilan.github.io/react-codepen-prefill/

Component Props

Internal

Property | Type | Required | Default | Description | -----------|----------|----------|-------------|---------------------------------------------------------------| label | string | false | '' | The text on the button/link | className | string | false | '' | The css class for the button/link | target | string | false | '' | HTML target attribute |

Passed to prefill a CodePen

Property | Type | Required | Default | Description | -----------------|----------|----------|-----------|---------------------------------------------------------------| title | string | false | '' | The title of the pen. description | string | false | '' | The description of the pen. tags | array | false | [] | An array of strings to act as tags. editors | string | false | '111' | Which editors are open. 1 is open. order is: HTML, CSS, JS. layout | string | false | 'left' | Optional layouts: top, left, right html | string | false | '' | The HTML code to fill in the HTML pane. htmlPreProcessor | string | false | 'none' | Optional values: "none", "slim", "haml", "markdown" css | string | false | '' | The CSS code to fill in the CSS pane. cssPreProcessor | string | false | 'none' | Optional values: "none", "less", "scss", "sass", "stylus" cssStarter | string | false | 'neither' | Optional values: "normalize", "reset", "neither", cssPrefix | string | false | 'neither' | Optional values: "autoprefixer", "prefixfree", "neither" js | string | false | '' | The JavaScript code to fill in the JS pane. jsPreProcessor | string | false | 'none' | Optional values: "none", "coffeescript", "babel", "livescript", "typescript" htmlClasses | string | false | '' | CSS class to apply to html tag. head | string | false | '' | Content to include inside the HTML head tag. cssExternal | string | false | '' | Use semi-colon to separate multiple files. jsExternal | string | false | '' | Use semi-colon to separate multiple files. private | boolean| false | false | Optional values: true, false - When the Pen is saved, it will save as Private if logged in user has that privledge, otherwise it will save as public parent | number | false | null | If supplied, the Pen will save as a fork of this id. Note it's not the slug, but ID. You can find the ID of a Pen with window.CP.pen.id in the browser console.

Authors

Ron Ilan

License

MIT

Fabriqué au Canada : Made in Canada