import {IDE} from '@primer/react-brand'
The IDE
does not automatically apply syntax highlighting to code snippets. Usage of this component in GitHub.com is expected to use the proprietary tokenizer and highlighter, the output of which can be passed directly into IDE
as a parameter.
See Storybook for examples of IDE
using highlight.js
syntax highlighter.
Line-by-line animations can be enabled using pre-formatted prop values. A replay button is enabled by default.
Simulate GitHub Copilot suggestions using the suggestedLineStart
property.
Simulate GitHub Copilot Chat using the IDE.Chat
sub-component. The script is fully customizable, and code snippets will require pre-formatting to enable syntax highlighting.
See Storybook for a comprehensive example of the Chat feature, inclusive of syntax highlighting.
See Chat example in StorybookA glass
variant is available to simplify placement of the IDE
on background images. This variant adds alpha transparency and background blurring.
name | type | default | required | description |
---|---|---|---|---|
alternativeText | string | true | Alternative description of the IDE | |
height | number | 800 | false | The optionally configurable height of the IDE |
variant | 'default' 'glass' | default | false | Alternative presentation of the IDE |
name | type | default | required | description |
---|---|---|---|---|
activeTab | number | false | Active tab index | |
files | IDEEditorFile[] | true | Array of editor files | |
showLineNumbers | boolean | false | Show line numbers in the editor | |
size | 'small' 'medium' 'large' | false | Controls editor text size | |
triggerAnimation | boolean | false | Trigger animation externally | |
showReplayButton | boolean | false | Show replay button |
Supported file extensions in the editor include: py
, ts
, js
, jsx
, hs
, html
, css
, scss
, json
, md
, yml
, yaml
, txt
, sh
, sql
name | type | default | required | description |
---|---|---|---|---|
script | IDEChatMessage[] | false | Array of chat messages | |
animationDelay | number | 3000 | false | Delay for the chat animation |