Documentation
Getting Started
Props

Props

You can pass props into the component. Here is a table of all the props you can pass, along with their explanations.

Table

PropDefaultOptionalType
tagdivtruestring
languagePlainTexttrueLanguage
themeDefaulttrueTheme
copyfalsetrueboolean
copyBtnThemeLighttrueLight or Dark
children" "falsestring

Explanation

  • tag: The tag name of the code block.
  • language: the language to highlight code in. View all available languages.
  • theme: the theme to use for highlighting. View all available themes.
  • copy: whether to show the copy button.
  • copyBtnTheme: the theme to use for the copy button.
  • children: this is where you pass your code text. You must pass it inside the component like this:
<ReactHighlightSyntax>
  {children}
</ReactHighlightSyntax>