Mantine's Code Highlighter Utility
One of the easiest ways to display code on-screen without it rendering. It even provides you with the "copy / copied" button functionality.
Sure you could write this utility yourself or just use <CodeHighlight /> instead.
Sure you could write this utility yourself or just use <CodeHighlight /> instead.
Summary: Visit https://mantine.dev/x/code-highlight/ for all of the specifics, but this is super-easy to use:
1. NPM install it
2. Import it into your component
3. Set some formatted code to display....
4. ...then spit it out to screen with the <CodeHighlight... /> component.
1. NPM install it
2. Import it into your component
3. Set some formatted code to display....
4. ...then spit it out to screen with the <CodeHighlight... /> component.