npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

terminal-block

v1.1.7

Published

A Vue 3 component library for rendering macOS-style terminal windows. Supports `ClaudeCode` and `Bash` app layouts with a themeable design.

Readme

Terminal Block

A Vue 3 component library for rendering macOS-style terminal windows. Supports ClaudeCode and Bash app layouts with a themeable design.

Installation

npm install terminal-block
# or
pnpm add terminal-block

vue (^3.5.0) is a peer dependency and must be installed separately.

Usage

Basic terminal window

Wrap any content in TerminalBlock to get the macOS window chrome (traffic-light dots + title bar).

<script setup>
import { TerminalBlock, Bash } from 'terminal-block'
</script>

<template>
  <TerminalBlock>
    <Bash>
      <Bash.Input>ls -la</Bash.Input>
      <Bash.Output>total 24 drwxr-xr-x 8 user staff 256</Bash.Output>
      <Bash.Input>npm run build</Bash.Input>
      <Bash.Output>Build failed: module not found</Bash.Output>
    </Bash>
  </TerminalBlock>
</template>

Claude Code terminal

<script setup>
import { TerminalBlock, ClaudeCode } from 'terminal-block'
</script>

<template>
  <TerminalBlock>
    <ClaudeCode version="v2.1.88" subtitle="Opus 4.6 · Max 100x" cwd="~/my-project">
      <ClaudeCode.Input>hello</ClaudeCode.Input>
      <ClaudeCode.Thinking>2s</ClaudeCode.Thinking>
      <ClaudeCode.Output>Hey! How can I help you today?</ClaudeCode.Output>
      <ClaudeCode.Output
        >Build completed in
        <span style="color: var(--terminal-block-ansi-yellow)">2.3s</span></ClaudeCode.Output
      >
    </ClaudeCode>
  </TerminalBlock>
</template>

In-progress thinking state

<ClaudeCode.Thinking :done="false" verb="analyzing" />
<!-- renders: "Analyzing..." -->

<ClaudeCode.Thinking done>5s</ClaudeCode.Thinking>
<!-- renders: "Thought for 5s" -->

Components

TerminalBlock

The outer window shell. Provides the title bar and applies the theme.

| Prop | Type | Default | Description | | ------- | -------------------------------- | ----------- | ------------------------------------- | | theme | string \| Partial<ThemeTokens> | "default" | Named theme or partial token override |

ClaudeCode

Renders a Claude Code session layout with logo, metadata header, and a slot for turns.

| Prop | Type | Default | Description | | ---------- | -------- | ----------------------- | -------------------------------------------- | | version | string | "v2.1.88" | Version string shown in the header | | subtitle | string | "Opus 4.6 · Max 100x" | Subtitle line below the title | | cwd | string | "~" | Working directory displayed in the header | | title | string | "✳ Claude Code" | Label shown in the TerminalBlock title bar |

Sub-components (compound component pattern):

  • ClaudeCode.Input — user prompt line, rendered with glyph
  • ClaudeCode.Output — assistant response line, rendered with glyph
  • ClaudeCode.Thinking — thinking indicator

ClaudeCode.Thinking props

| Prop | Type | Default | Description | | ------ | --------- | ------------ | ---------------------------------------------------------------- | | done | boolean | false | false shows "Verb...", true shows "Thought for <slot>" | | verb | string | "thinking" | Action verb used in the in-progress state |

Bash

Renders a plain bash session.

| Prop | Type | Default | Description | | ------- | -------- | -------- | -------------------------------------------- | | title | string | "bash" | Label shown in the TerminalBlock title bar |

Sub-components:

  • Bash.Input — command line, rendered with $ glyph
  • Bash.Output — command output, no glyph

Inline color styling

The named color components (Red, Green, Yellow, Blue, Magenta, Cyan, White) were removed in v2.0.0. Use a <span> with the corresponding theme CSS variable instead:

<!-- Before (v1.x) -->
<ClaudeCode.Output>Status: <Green>OK</Green></ClaudeCode.Output>

<!-- After (v2.0+) -->
<ClaudeCode.Output>Status: <span style="color: var(--terminal-block-ansi-green)">OK</span></ClaudeCode.Output>

Available ANSI color variables: --terminal-block-ansi-red, --terminal-block-ansi-green, --terminal-block-ansi-yellow, --terminal-block-ansi-blue, --terminal-block-ansi-magenta, --terminal-block-ansi-cyan, --terminal-block-ansi-white.

Theming

Default theme

The default theme is based on GitHub Dark. You can import it directly:

import { defaultTheme } from 'terminal-block'

Custom theme tokens

Pass a partial ThemeTokens object to override specific colors:

<TerminalBlock :theme="{ bg: '#0d1117', text: '#e6edf3', accent: '#58a6ff' }">
  ...
</TerminalBlock>

Available ThemeTokens keys:

| Token | Description | | ------------- | ----------------------- | | bg | Window background | | headerBg | Title bar background | | inputBg | Input row background | | codeBg | Code block background | | text | Primary text color | | secondary | Secondary text color | | muted | Muted/dimmed text color | | accent | Accent color | | divider | Divider line color | | ansiRed | ANSI red | | ansiGreen | ANSI green | | ansiYellow | ANSI yellow | | ansiBlue | ANSI blue | | ansiMagenta | ANSI magenta | | ansiCyan | ANSI cyan | | ansiWhite | ANSI white |

Named themes

<TerminalBlock theme="default">
  ...
</TerminalBlock>

iTerm2 color schemes

You can convert an iTerm2 .itermcolors file into theme tokens:

import { parseItermColors } from 'terminal-block'

const xml = `<?xml version="1.0" ...>...</xml>` // .itermcolors file contents
const theme = parseItermColors(xml)

In a Node.js environment (e.g. build-time or SSR), use loadItermColorsFile to read from disk:

import { loadItermColorsFile } from 'terminal-block'

const theme = await loadItermColorsFile('./my-theme.itermcolors')

Then pass the result as the theme prop:

<TerminalBlock :theme="theme">
  ...
</TerminalBlock>

resolveTheme

Resolve a named theme string or a partial token object into a Partial<ThemeTokens>:

import { resolveTheme } from 'terminal-block'

const tokens = resolveTheme('default')

License

MIT