Code
This is the replacement for code HTML tags. It works as inline <code />
or
block <pre />
tags.
<Code animate>window.requestAnimationFrame(this.nextFrame);</Code>
The component uses prismjs internally so if the component is imported it is imported with it.
Prop name | Type | Default | Description |
---|---|---|---|
Animation | any | AnimationComponent | |
theme | any | Required | |
classes | any | Required | |
animate | bool | ||
show | bool | true | |
animation | object | ||
type | enum | 'code' | If the code snippet is inline or block type. One of: 'code' , 'pre' |
language | string | 'javascript' | The programming language. Supported by Prism. |
Method name | Parameters | Description |
---|---|---|
highlight |
Source code: src/Code
Open in: Playground