UikCodeHighlight

This is a wrapping component with styles and some extra logic above PrismJS.

PropertyTypeRequiredDefault ValueDescription
languageStringtrue

Language to parse, visit prismjs to see supported languages. By default, this component imports only javascript, jsx, markup, css, and json highlighting. If you want to use another syntax, you will have to import it as following:import 'prismjs/components/prism-yourlang' in your files

codeStringtrue

Code to be highlighted

...restanyfalse

Other properties passed down to the refractor component. See the documentation for more information.

UikCodeHighlight Examples

ComponentExample Code
const hello = "Hello Kit'
<UikCodeHighlight
  code={ 'const hello = "Hello Kit" }
  language="javascript"
/>