children | string | Required – This is the code snippet that will be rendered in the code block. | '' |
multiline | boolean | This prop determines whether or not the code snippet will visually retain line breaks when rendered. | true |
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. | |
variant | 'dark' , 'light' | Determines whether to use a light or dark highlighting palette. | 'light' |
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 |