Code
Component used to present a block of code in a Toolkit element

The code block is parsed with Prettier before it is rendered.
Usage
Properties
Property
Type
Description
className
String
The Class name to apply to the component
Default: rtk-code
foldGutter
Boolean
Enable folding
Default: true
lineNumbers
Boolean
Hide/show the line numbers.
Default: true
lineWrapping
Boolean
Wrap long lines of code.
Default: false
id
String
ID value used for action Zone.
Default: code
indentUnit
Number
Number of spaces used when indenting.
Default: 4
readOnly
Boolean
Disable live editing.
Default: false
value
String
The block of code to output
onChange
Function
Called when the change event is triggered.
Events
change
Triggered when the code value is changed.
Theme
You can theme the Code block by supplying the following scss variables before the Toolkit styles are imported:
Last updated