Skip to content

ViewCode

Used to display and highlight dynamic code blocks.

This is a plain text block
import { ViewCode } from '@fintech-sandpit/ui/react';
const value = 'const getExampleString = (): string => {
return 'This is a code block';
}';
return (
<ViewCode
value={value}
language="typescript"
/>
);
NameTypeDefaultDescription
valuestringThe value of the code block
languageLanguage plaintextThe language of the code block
type Language = (
| 'bash'
| 'c'
| 'cpp'
| 'csharp'
| 'css'
| 'diff'
| 'dockerfile'
| 'erlang'
| 'go'
| 'graphql'
| 'http'
| 'java'
| 'javascript'
| 'json'
| 'kotlin'
| 'objectivec'
| 'php'
| 'plaintext'
| 'python'
| 'shell'
| 'sql'
| 'typescript'
| 'xml'
| 'yaml'
)