From e96f8d04544ec65454936d50c1ea4cb1f1969606 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 19:40:27 +0000 Subject: [PATCH 1/3] Update components/terminal.mdx --- components/terminal.mdx | 232 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 components/terminal.mdx diff --git a/components/terminal.mdx b/components/terminal.mdx new file mode 100644 index 000000000..aa351e41c --- /dev/null +++ b/components/terminal.mdx @@ -0,0 +1,232 @@ +--- +title: "Terminal" +description: "Display command-line interfaces and terminal output with syntax highlighting" +icon: "terminal" +--- + +import IconsOptional from "/snippets/icons-optional.mdx"; + +Use the terminal widget to display command-line interfaces, terminal sessions, and code execution output. The terminal widget provides a realistic terminal appearance with customizable themes and interactive features. + +## Basic terminal + + +$ npm install @mintlify/terminal +✓ Package installed successfully +$ npm start +Starting development server... +Server running on http://localhost:3000 + + +```mdx Terminal example + +$ npm install @mintlify/terminal +✓ Package installed successfully +$ npm start +Starting development server... +Server running on http://localhost:3000 + +``` + +## Terminal with title + +Add a title to provide context for the terminal session. + + +$ git clone https://github.com/your-repo/project.git +Cloning into 'project'... +$ cd project +$ npm install +Installing dependencies... + + +```mdx Terminal with title + +$ git clone https://github.com/your-repo/project.git +Cloning into 'project'... +$ cd project +$ npm install +Installing dependencies... + +``` + +## Terminal themes + +Customize the appearance with different terminal themes. + +### Dark theme (default) + + +$ ls -la +total 24 +drwxr-xr-x 4 user staff 128 Dec 1 10:30 . +drwxr-xr-x 3 user staff 96 Dec 1 10:29 .. +-rw-r--r-- 1 user staff 1024 Dec 1 10:30 README.md +-rw-r--r-- 1 user staff 2048 Dec 1 10:30 package.json + + +### Light theme + + +$ whoami +developer +$ pwd +/home/developer/projects + + +```mdx Terminal themes + +$ ls -la +total 24 +drwxr-xr-x 4 user staff 128 Dec 1 10:30 . + + + +$ whoami +developer + +``` + +## Interactive terminal + +Enable interactive features like copy buttons and command highlighting. + + +$ curl -X GET https://api.example.com/users +{ + "users": [ + {"id": 1, "name": "John Doe"}, + {"id": 2, "name": "Jane Smith"} + ] +} +$ curl -X POST https://api.example.com/users \ + -H "Content-Type: application/json" \ + -d '{"name": "New User"}' +{"id": 3, "name": "New User", "created": true} + + +```mdx Interactive terminal + +$ curl -X GET https://api.example.com/users +{ + "users": [ + {"id": 1, "name": "John Doe"}, + {"id": 2, "name": "Jane Smith"} + ] +} + +``` + +## Multi-step commands + +Show complex workflows with multiple commands and outputs. + + +$ docker build -t myapp . +Sending build context to Docker daemon 2.048kB +Step 1/5 : FROM node:16-alpine + ---> 1234567890ab +Step 2/5 : WORKDIR /app + ---> Running in abcdef123456 + ---> fedcba654321 +Successfully built fedcba654321 +Successfully tagged myapp:latest + +$ docker run -p 3000:3000 myapp +Server starting... +✓ Application ready on port 3000 + + +```mdx Multi-step terminal + +$ docker build -t myapp . +Sending build context to Docker daemon 2.048kB +Step 1/5 : FROM node:16-alpine + ---> 1234567890ab +Successfully tagged myapp:latest + +$ docker run -p 3000:3000 myapp +Server starting... +✓ Application ready on port 3000 + +``` + +## Error handling + +Display error messages and troubleshooting information. + + +$ npm test +> test +> jest + +FAIL src/components/Button.test.js + ✕ should render correctly (5ms) + +Error: Cannot find module 'react-testing-library' + at Object. (src/components/Button.test.js:2:1) + +$ npm install --save-dev @testing-library/react ++ @testing-library/react@13.4.0 +added 1 package + +$ npm test +> test +> jest + +PASS src/components/Button.test.js + ✓ should render correctly (12ms) + +Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total + + +```mdx Error handling terminal + +$ npm test +FAIL src/components/Button.test.js + ✕ should render correctly (5ms) + +Error: Cannot find module 'react-testing-library' + +$ npm install --save-dev @testing-library/react ++ @testing-library/react@13.4.0 +added 1 package + +$ npm test +PASS src/components/Button.test.js + ✓ should render correctly (12ms) + +``` + +## Properties + + + Optional title displayed at the top of the terminal window. + + + + Terminal color theme. Options: `dark`, `light`, `matrix`, `retro`. + + + + Enable interactive features like copy buttons and command highlighting. + + + + Set a fixed height for the terminal (e.g., `300px`, `20rem`). + + + + Set a maximum height with scrolling for long output. + + + + Display line numbers for each line of output. + + + + Allow users to copy terminal content to clipboard. + + + \ No newline at end of file From 5486ff9718dfe8bbf9d252d5bdf224e5d51595a7 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 19:40:43 +0000 Subject: [PATCH 2/3] Update docs.json --- docs.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docs.json b/docs.json index e364b4726..025d2418f 100644 --- a/docs.json +++ b/docs.json @@ -84,6 +84,7 @@ "components/panel", "components/steps", "components/tabs", + "components/terminal", "components/tooltips", "components/update", "components/banner" From 652b46a1436a1f1dfc780d141efd190f913b1172 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 19:42:33 +0000 Subject: [PATCH 3/3] Update components/terminal.mdx --- components/terminal.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/terminal.mdx b/components/terminal.mdx index aa351e41c..49724152b 100644 --- a/components/terminal.mdx +++ b/components/terminal.mdx @@ -6,6 +6,8 @@ icon: "terminal" import IconsOptional from "/snippets/icons-optional.mdx"; +**THIS IS A GATED ENTERPRISE FEATURE** + Use the terminal widget to display command-line interfaces, terminal sessions, and code execution output. The terminal widget provides a realistic terminal appearance with customizable themes and interactive features. ## Basic terminal