Socket
Socket
Sign inDemoInstall

simple-codesandbox

Package Overview
Dependencies
15
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simple-codesandbox

easily display configurable codesandbox iframe


Version published
Weekly downloads
7
Maintainers
1
Created
Weekly downloads
 

Readme

Source

simple-codesandbox

easily display configurable codesandbox iframe

Codacy Badge NPM JavaScript Style Guide

Install

npm install --save simple-codesandbox

or

npm install --save simple-codesandbox

Embed Options

The options shown in the embed modal are not all options available. We need a new UI for the share model to reflect these options, in the meantime you can find them here.

OptionDescriptionValuesDefault
codeMirrorUse CodeMirror editor instead of Monaco (decreases embed size significantly).booleanfalse
editorSizeSize in percentage of editor.number50
eslintUse eslint (increases embed size significantly).booleanfalse
expandDevToolsStart with the devtools (console) open.booleanfalse
fontSizeFont size of editornumber (in px)14
forceRefreshForce a full refresh of frame after every edit.booleanfalse
hideNavigationHide the navigation bar of the preview.booleanfalse
highlightsWhich lines to highlight (only works in CodeMirror)comma separated list of line numbers
initialPathWhich url to initially load in address barstring/
moduleViewEvaluate the file that is open in the editor.booleanfalse
previewWindowWhich preview window to open by defaultconsole / tests / browserbrowser
runOnClickOnly load the preview when the user says so.booleanfalse
verticalLayoutWhether to show the editor and preview vertically.booleanfalse
viewWhich view to open by defaulteditor / split / previewsplit, preview for small screens
moduleWhich module to open by default. Multiple paths comma separated are allowed, in that case we show them as tabspath to module (starting with /)entry path

Example Embeds

These are some examples of embeds, based on their properties.

Usage

const App = () => (
  <CodeSandbox sandbox="github/glweems/empty-sandbox" />
)

Smallest Embed

const App = () => (
  <CodeSandbox sandbox="github/glweems/empty-sandbox" codeMirror />
)

License

MIT © glweems

FAQs

Last updated on 28 Aug 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc