Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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 class="container"></div>


                .App {
  text-align: center;

li {
  list-style: none;



                function App() {
  const jsonArray = csv2json(originalData);

  return (
    <div className="App">
        { => {
          return (
            <li key={v["id"]}>
              <p>id: {} </p>
              <p>上の句: {v.上の句} </p>
              <p>下の句: {v.下の句} </p>

const originalData = `
上の句, 下の句
あさぼらけう "あらわれわたる"
あきのたの, わがころもでは
// type Item = {
//   "id": number;
//   "上の句": string;
//   "下の句": string
// }

const csv2json = (csvData) => {
  let csvLines = csvData.split("\n").filter(Boolean); // 行ごとに分割する
  const keyNames = csvLines[0].split(/[\n\s\"\',;.]+/); // [ '上の句', ' 下の句' ]
  let jsonArray = [];
  for (let i = 1; i < csvLines.length; i++) {
    // 0行目は見出しに使ったので1行目から
    let a_line = new Object();
    let csvArrayData = csvLines[i].split(/[\n\s\"\',;.]+/); // [ 'あさぼらけ', ' あらわれわたる' ]
    a_line["id"] = i;
    for (let j = 0; j < keyNames.length; j++) {
      a_line[keyNames[j]] = csvArrayData[j];

  return jsonArray;
export default App;

ReactDOM.render(<App />, document.querySelector(".container"));