Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-kotlin-playground

zoobestik990MIT0.1.0-beta.14TypeScript support: included

React wrapper for kotlin playground

react, kotlin, playground, component

readme

React Kotlin Playground

npm dependencies dependencies downloads

React wrapper for kotlin-playground widget.

Install

npm i --save react-kotlin-playground kotlin-playground

Usage

import React from "react";
import ReactDOM from "react-dom";
import KotlinPlayground from "react-kotlin-playground";
// For modern bundle:
// import KotlinPlayground from 'react-kotlin-playground/es';

ReactDOM.render(
    <KotlinPlayground mode="kotlin">
        fun main(args: Array&lt;String&gt;){" "}
        {
            //sampleStart
            println("Hello World")
            //sampleEnd
        }
    </KotlinPlayground>,
    container
);

API

Name Type Default Description
className string null Add classes for codewrapper
children node | Initial source code for run

Plus all options and events from original library:

in react props style - without data- prefix and in camelCase, like

<KotlinPlayground
    autoIndent={2}
    targetPlatform="js"
    {/* ...and any other */ }
>...</KotlinPlayground>

or in html attrs style - like in original library:

<KotlinPlayground
    auto-indent={2}
    data-target-platform="js"
    {/* ...and any other */ }
>...</KotlinPlayground>

More props options

Acknowledgements

Develop By MIT license

changelog

Change Log

0.1.0-beta.12

  • rollback server support due to a bug

0.1.0-beta.11

  • support server

0.1.0-beta.10

  • support react@17-18

0.1.0-beta.9

  • support crosslink

0.1.0-beta.8

  • support trackRunId

0.1.0-beta.7

  • Use .mjs of .cjs for import

0.1.0-beta.6

  • Add typings for dist

0.1.0-beta.5

  • Add TS typings
  • Fix require typings

0.1.0-beta.4

  • Add dumb component.

0.1.0-beta.3

  • Add className to supported props.

0.1.0-beta.2

  • Fix IE11 support
  • Prevent publishing non-builded package

0.1.0-beta.1

Simple wrapper for kotlin-playground.