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 nameTypeDefaultDescription
AnimationanyAnimationComponent
themeanyRequired
classesanyRequired
animatebool
showbooltrue
animationobject
typeenum'code'

If the code snippet is inline or block type.

One of: 'code', 'pre'
languagestring'javascript'

The programming language. Supported by Prism.

Method nameParametersDescription
highlight

Source code: src/Code Open in: Playground