Alpha: Ships on npm at 7.0.0-alpha.07.0.0-alpha.0
terminal
The code window: dark in every Theme and scheme, plain or tabbed.
Seen on pages/home.json, the landing, section 3.
Variant
{
"kind": "section",
"shell": {
"id": "bound",
"inset": "contained",
"density": "section",
"surface": "plate"
},
"block": {
"type": "terminal",
"variant": "plain",
"title": "Titles stop at 64.",
"lang": "js",
"copy": false,
"lines": [
"const hero = page.sections[1].block;",
"hero.title = 'A truly stunning, '",
" + 'beautiful and modern page '",
" + 'for every brand you launch.';",
"const [{ path, maximum }] = PageSchema",
" .safeParse(page).error.issues;",
"// path: sections.1.block.title",
"// maximum: 64",
"hero.title = 'One record. Every brand.';",
"PageSchema.safeParse(page).success;",
"// true"
]
}
}
{
"title": "terminal",
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "terminal"
},
"variant": {
"type": "string",
"const": "plain"
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 48
},
"lang": {
"type": "string",
"enum": [
"text",
"bash",
"sh",
"shell",
"zsh",
"console",
"curl",
"http",
"json",
"jsonc",
"js",
"javascript",
"jsx",
"ts",
"typescript",
"tsx",
"py",
"python",
"go",
"golang",
"rb",
"ruby",
"php",
"java",
"kt",
"kotlin",
"cs",
"csharp",
"rs",
"rust",
"swift",
"sql",
"graphql",
"gql",
"yaml",
"yml",
"toml",
"ini",
"env",
"dotenv",
"html",
"xml",
"diff",
"patch"
]
},
"lines": {
"minItems": 1,
"maxItems": 32,
"type": "array",
"items": {
"type": "string",
"maxLength": 100
}
},
"copy": {
"type": "boolean"
}
},
"required": [
"type",
"variant",
"lines"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "terminal"
},
"variant": {
"type": "string",
"const": "tabs"
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 48
},
"group": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]{0,23}$"
},
"tabs": {
"minItems": 1,
"maxItems": 4,
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string",
"minLength": 1,
"maxLength": 6
},
"lines": {
"minItems": 1,
"maxItems": 24,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"cmd": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"space": {
"type": "string",
"enum": [
"after",
"both"
]
}
},
"required": [
"cmd"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"row": {
"type": "array",
"prefixItems": [
{
"type": "string",
"minLength": 1,
"maxLength": 16
},
{
"type": "string",
"minLength": 1,
"maxLength": 56
}
],
"items": false,
"minItems": 2,
"maxItems": 2
}
},
"required": [
"row"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"out": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"cursor": {
"type": "boolean"
}
},
"required": [
"out"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"gap": {
"type": "string",
"enum": [
"sm",
"lg"
]
}
},
"required": [
"gap"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"text": {
"type": "string",
"minLength": 1,
"maxLength": 128
}
},
"required": [
"text"
],
"additionalProperties": false
}
]
}
},
"pre": {
"type": "boolean"
}
},
"required": [
"label",
"lines"
],
"additionalProperties": false
}
},
"copy": {
"type": "boolean"
}
},
"required": [
"type",
"variant",
"group",
"tabs"
],
"additionalProperties": false
}
]
}{
"kind": "section",
"shell": { "id": "bound", "inset": "contained", "density": "section", "surface": "plate" },
"block": {
"type": "terminal",
"variant": "plain",
"title": "Titles stop at 64.",
"lang": "js",
"lines": [
"const hero = page.sections[1].block;",
"hero.title = 'A truly stunning, '",
" + 'beautiful and modern page '",
" + 'for every brand you launch.';",
"const [{ path, maximum }] = PageSchema",
" .safeParse(page).error.issues;",
"// path: sections.1.block.title",
"// maximum: 64",
"hero.title = 'One record. Every brand.';",
"PageSchema.safeParse(page).success;",
"// true"
],
"copy": false
}
}Smallest that parses
{
"type": "terminal",
"variant": "plain",
"title": "Titles stop at 64.",
"lines": ["const hero = page.sections[1].block;"]
}Props
From @mdxui/site@7.0.0-alpha.0. A count reads as min–max × item; a string bound is its maximum length in characters, and links its refusal.
variant: "plain"
| Prop | Type and bound | Required |
|---|---|---|
variant | "plain" | yes |
title | string ≤48 | no |
lang | icon or mark name (44) | no |
lines | 1–32 × string ≤100 | yes |
copy | boolean | no |
variant: "tabs"
| Prop | Type and bound | Required |
|---|---|---|
variant | "tabs" | yes |
title | string ≤48 | no |
group | string (pattern) | yes |
tabs | 1–4 × object | yes |
tabs[].label | string ≤6 | yes |
tabs[].lines | 1–24 × object | object | object | object | object | yes |
tabs[].lines[].cmd | string ≤64 | yes |
tabs[].lines[].space | "after" | "both" | no |
tabs[].lines[].row | [string ≤16, string ≤56] | yes |
tabs[].lines[].out | string ≤64 | yes |
tabs[].lines[].cursor | boolean | no |
tabs[].lines[].gap | "sm" | "lg" | yes |
tabs[].lines[].text | string ≤128 | yes |
tabs[].pre | boolean | no |
copy | boolean | no |
Use instead
command-row: one command to copyapi-call: a request beside its answer