Skip to content

io.display.code

Represents a display.code component.

Usage

ts
const code = dedent(```
  forge-dev-cli init-local-workstation
  forge-dev-cli setup-dev-container
```)

await io.display.code("Run the CLI to configure your local development environment", {
  code,
  language: "bash",
})
python
code=textwrap.dedent("""
    forge-dev-cli init-local-workstation
    forge-dev-cli setup-dev-container
""")

await io.display.code(
    "Run the CLI to configure your local development environment",
    code=code
    language="bash",
)

example of Forge app with display.code component

Props

code Required

string
The text for the source code to display.

language Optional

string
The language of the source code for syntax highlighing. Supported values are "bash", "c", "cpp", "csharp", "css", "diff", "go", "ini", "java", "javascript", "json", "kotlin", "less", "lua", "makefile", "markdown", "objectivec", "perl", "php", "php-template", "plaintext", "python", "python-repl", "r", "ruby", "rust", "scss", "shell", "sql", "swift", "typescript", "vbnet", "xml", and "yaml".

Returns null