react-kotlin-playground
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-beta.14 • Public • Published

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

Package Sidebar

Install

npm i react-kotlin-playground

Weekly Downloads

960

Version

0.1.0-beta.14

License

MIT

Unpacked Size

70.3 kB

Total Files

11

Last publish

Collaborators

  • nikpachoo
  • zoobestik