Back to Components

CodeBlock

A syntax highlighting code block component, which uses PrismJS under the hood.
import Two from 'two.js';

const two = new Two({
  autostart: true,
  type: 'CanvasRenderer',
  height: 600,
  width: 1000,
}).appendTo(document.getElementById('TwoContainer'));

const circle = two.makeCircle(72, 100, 50);
const square = two.makeRectangle(213, 100, 100, 100);

<CodeBlock>

PropertyTypeDefaultEditor
children

String

language

OneOf

wrap

Boolean