children | string | Required – This is the code snippet that will be rendered in the code block. | '' |
language | 'javascript' , 'typescript' , 'cs' , 'csharp' , 'cpp' , 'go' , 'java' , 'perl' , 'php' , 'python' , 'ruby' , 'scala' , 'swift' , 'kotlin' ,'objectivec' , 'bash' , 'shell' , 'sql' , 'yaml' , 'json' , 'diff' , 'none' | Required – The language to highlight the code block as. When set to 'none' , no syntax highlighting will be applied. | |
darkMode | boolean | Determines whether or not the component will appear in dark mode. | false |
className | string | Applies a className to the root element's classList. | |
showLineNumbers | boolean | Shows line numbers next to each line of code in the passed code snippet. NOTE: While you can set this to true regardless of the code component being multiline, the line numbers will not be displayed if the multiline prop is true . | false |
showWindowChrome | boolean | Shows a stylized window chrome frame around the code snippet. This is purely stylistic. | false |
chromeTitle | string | Shows a filename-like title in the window chrome frame.NOTE: While you can set this prop if showWindowChrome is false , it will not be displayed unless the showWindowChrome prop is true . | '' |
onCopy | Function | Callback fired when Code is copied | |
copyable | boolean | When true, allows the code block to be copied to the user's clipboard | true |
highlightLines | `Array<number | [number, number]>` | An optional array of lines to highlight. The array can only contain numbers corresponding to the line numbers to highlight, and / or tuples representing a range (e.g. [6, 10] ); |