AI Agents Fancy Stable

TerminalBlock

Live command transcript: the prompt line, output as it streams in with its ANSI colours read, a block cursor while it runs, and an exit-status footer when it stops

Preview

Installation

pnpm add fancy-ui-svelte
import { TerminalBlock } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { TerminalBlock } from 'fancy-ui-svelte';
</script>

<TerminalBlock />

Examples

Basic Usage

Props

PropTypeDefaultDescription
output *string-Everything the command has printed so far, not the latest chunk; reassign as lines arrive
command string-The command that produced the output, shown after the prompt glyph
prompt string"$"Prompt glyph in front of the command
running booleanfalseWhether the command is still running: shows the cursor, pins the scroll
exitCode number | nullnullAnything other than null ends the run and shows the status footer
durationMs number-How long the run took, shown next to the exit status
ansi booleantrueRead the SGR subset and colour the output; false still strips the escapes, it just paints nothing
maxHeight string"20rem"Height at which the output starts scrolling

Slots

SlotDescription
headerTitle bar above the output — window dots, a file name, a copy button