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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.




                html, body {
  width: 100%;
  height: 100%;

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Indie Flower', cursive;
  background-color: #fffb89;

.app {
  max-width: 450px;
  font-size: 30px;
  line-height: 1.6em;
  text-align: justify;

.pen-stroke {
  position: relative;
  display: inline;
  color: #ff2727;
  svg {
    position: absolute;
    top: 1.2em;
    left: 0;
    width: 100%;
    overflow: visible;
    path {
      fill: none;
      stroke: #ff2727;
      stroke-linecap: round;
      stroke-linejoin: round;
      vector-effect: non-scaling-stroke;


                import React from '';
import ReactDOM from '';

const random = (from, to) => Math.floor(Math.random() * (to - from) + from);

const Underline = ({children}) => {
  const strokeWidth = random(16, 20) / 100;
  const height = random(4, 8);
  let lines = random(2, 4);
  let d = `M ${random(-5, 15)} ${random(-2, 2)}`;
  let line = 0;
  // Draw the lines
  while (line++ < lines) {
    const y = line * (height / lines); // Draw every line lower than the previous one
    d += ` Q ${random(30, 70)}` + // The x coordinate of the curve's center
         ` ${random(y - 5, y + 5)}` + // The y coordinate of the curve's center
         ` ${line % 2 === 0 ? random(-5, 15) : random(85, 105)}` + // The x coordinate of the curve's end, alternating between right to left based on the current line number
         ` ${random(y - 2, y + 2)}`; // The y coordinate of the curve's end
  return (
    <div className='pen-stroke'>
      <svg viewBox={`0 0 100 ${height}`} height={height} xmlns='' preserveAspectRatio='none'>
        <path d={d} strokeWidth={`${strokeWidth}em`}/>

const App = () => (
  <div className='app'>
    These <Underline>underline</Underline> pen strokes are <Underline>randomly</Underline> generated, making each of them <Underline>unique</Underline>. The <Underline>strokes</Underline> automatically take the <Underline>width</Underline> of the text that they <Underline>underline</Underline>, like this very <Underline>looooooooooooooooooong</Underline> word.