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.


                <div id="app"></div>



                @import url('');

$font: #00FF41;
$bg: #003B00;

body {
  font-family: 'VT323', monospace;
  background-color: $bg;
  padding: 1em 2em;

h1 {
  color: $font;

#cursor {
  border-left: .1em solid $font;
  animation: blink .7s steps(1) infinite;

@keyframes blink {
  50% {
    border-color: transparent;


const TYPING_SPEED = 150;
const DELETING_SPEED = 30;

class Typer extends React.Component {

  state = {
    text: '',
    isDeleting: false,
    loopNum: 0,
    typingSpeed: TYPING_SPEED

  componentDidMount() {

  handleType = () => {
    const { dataText } = this.props;
    const { isDeleting, loopNum, text, typingSpeed } = this.state;
    const i = loopNum % dataText.length;
    const fullText = dataText[i];

      text: isDeleting ? fullText.substring(0, text.length - 1) : fullText.substring(0, text.length + 1),
      typingSpeed: isDeleting ? DELETING_SPEED : TYPING_SPEED

    if (!isDeleting && text === fullText) {     
      setTimeout(() => this.setState({ isDeleting: true }), 500);   
    } else if (isDeleting && text === '') {
        isDeleting: false,
        loopNum: loopNum + 1

    setTimeout(this.handleType, typingSpeed);

  render() {
    return (
      <h1>{ this.props.heading }&nbsp;
        <span>{ this.state.text }</span>
        <span id="cursor"></span>

    heading="Things for hipsters:"
      'Vinyl swag.', 
      'Seitan jianbing.',
      'Enamel pin meditation.',
      'Denim seitan.',
      'Semiotics austin.',
      'Sriracha fanny pack.',
      'Vape raw dreamcatcher.',
      'Fam blog.',
      '90s church-key.',
      'Pabst distillery.',
      'Street art unicorn.'