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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sylphx/solid-tui-components

v0.1.5

Published

UI components for solid-tui: ProgressBar, Table, Divider, Link, TitledBox, and more

Downloads

288

Readme

@sylphx/solid-tui-components

UI components for building beautiful terminal interfaces

npm version License: MIT

A collection of UI components for building terminal user interfaces with Solid-TUI. Progress bars, tables, dividers, links, and more—all powered by SolidJS's fine-grained reactivity.

📦 Installation

npm install @sylphx/solid-tui-components solid-js @sylphx/solid-tui

🎯 Components

ProgressBar

Visual progress indicator with customizable characters and colors.

Features:

  • Customizable characters (complete/incomplete)
  • Percentage display
  • Configurable width
  • Auto-clamping (0-100%)

Props:

  • value?: number - Current value (default: 0)
  • total?: number - Maximum value (default: 100)
  • width?: number - Bar width in characters (default: 20)
  • character?: string - Character for both complete/incomplete
  • completeCharacter?: string - Character for completed portion (default: '█')
  • incompleteCharacter?: string - Character for incomplete portion (default: '░')
  • showPercentage?: boolean - Show percentage text (default: true)
  • color?: string - Bar color (default: 'green')

Example:

import { render, Box } from '@sylphx/solid-tui';
import { ProgressBar } from '@sylphx/solid-tui-components';

function App() {
  return (
    <Box flexDirection="column">
      <ProgressBar value={75} total={100} width={30} color="cyan" />
      <ProgressBar
        value={45}
        total={100}
        completeCharacter="●"
        incompleteCharacter="○"
      />
    </Box>
  );
}

render(<App />);

Table

Data table with borders, alignment, and striping.

Features:

  • Multiple border styles (single, double, round, bold, classic, none)
  • Column alignment (left, center, right)
  • Auto-width calculation
  • Striped rows
  • Custom rendering per column

Props:

  • columns: TableColumn[] - Column definitions
  • data: T[] - Data rows
  • borderStyle?: 'single' | 'double' | 'round' | 'bold' | 'classic' | 'none' - Border style (default: 'single')
  • striped?: boolean - Alternate row colors (default: false)

Types:

interface TableColumn<T = any> {
  key: string;
  title: string;
  width?: number;  // Auto-calculated if not provided
  align?: 'left' | 'center' | 'right';  // Default: 'left'
  render?: (value: any, row: T) => string;  // Custom renderer
}

Example:

import { Table } from '@sylphx/solid-tui-components';

function UserTable() {
  const columns = [
    { key: 'name', title: 'Name', width: 15 },
    { key: 'age', title: 'Age', width: 5, align: 'right' },
    { key: 'email', title: 'Email', width: 25 },
    {
      key: 'status',
      title: 'Status',
      width: 10,
      render: (val) => val === 'active' ? '✓ Active' : '✗ Inactive'
    },
  ];

  const data = [
    { name: 'Alice', age: 28, email: '[email protected]', status: 'active' },
    { name: 'Bob', age: 34, email: '[email protected]', status: 'inactive' },
  ];

  return <Table columns={columns} data={data} borderStyle="double" striped />;
}

Divider

Horizontal divider with optional title.

Features:

  • Optional centered title
  • Customizable character
  • Configurable width
  • Color customization

Props:

  • title?: string - Optional centered title
  • width?: number - Divider width (default: 50)
  • character?: string - Divider character (default: '─')
  • color?: string - Divider color (default: 'dim')
  • titleColor?: string - Title color (defaults to divider color)

Example:

import { Divider } from '@sylphx/solid-tui-components';

function App() {
  return (
    <Box flexDirection="column">
      <Text>Section 1</Text>
      <Divider />

      <Text>Section 2</Text>
      <Divider title="Important" titleColor="yellow" />

      <Text>Section 3</Text>
      <Divider character="═" color="blue" width={60} />
    </Box>
  );
}

Link

Clickable hyperlink with OSC 8 support.

Features:

  • Auto-detection of terminal hyperlink support
  • Fallback for unsupported terminals
  • Styled as blue underlined text

Supported Terminals:

  • iTerm2
  • WezTerm
  • VS Code integrated terminal
  • Windows Terminal
  • Konsole

Props:

  • url: string - Target URL
  • label?: string - Link text (defaults to URL)

Example:

import { Link } from '@sylphx/solid-tui-components';

function App() {
  return (
    <Box flexDirection="column">
      <Link url="https://solid-tui.sylphx.com" />
      <Link url="https://github.com/SylphxAI/solid-tui" label="View on GitHub" />
    </Box>
  );
}

TitledBox

Bordered container with title.

Features:

  • 5 border styles (single, double, round, bold, classic)
  • Customizable border and title colors
  • Configurable width and padding
  • Centered title in top border

Props:

  • title: string - Box title
  • children: JSX.Element - Box content
  • width?: number - Box width (default: 50)
  • borderStyle?: 'single' | 'double' | 'round' | 'bold' | 'classic' - Border style (default: 'single')
  • borderColor?: string - Border color (default: 'white')
  • titleColor?: string - Title color (defaults to border color)
  • padding?: number - Internal padding (default: 1)

Example:

import { TitledBox } from '@sylphx/solid-tui-components';

function App() {
  return (
    <Box flexDirection="column">
      <TitledBox title="Configuration" width={40}>
        <Text>API Key: ****************</Text>
        <Text>Endpoint: https://api.example.com</Text>
      </TitledBox>

      <TitledBox
        title="Warning"
        borderStyle="double"
        borderColor="yellow"
        width={40}
      >
        <Text>This action cannot be undone!</Text>
      </TitledBox>
    </Box>
  );
}

🎨 Border Styles

All components with borders support these styles:

  • single: ┌─┐ │ └─┘ (default)
  • double: ╔═╗ ║ ╚═╝
  • round: ╭─╮ │ ╰─╯
  • bold: ┏━┓ ┃ ┗━┛
  • classic: +-+ | +-+
  • none: No borders (Table only)

🎨 Examples

Run the included examples:

npm run example:progress   # ProgressBar demo
npm run example:table      # Table demo
npm run example:divider    # Divider demo
npm run example:link       # Link demo
npm run example:titled     # TitledBox demo

🔧 Development

# Build package
npm run build

# Run tests
npm test

# Watch mode
npm run dev

📖 API Reference

See TypeScript definitions for complete API documentation.

🤝 Contributing

Contributions are welcome! Please read the Contributing Guide for details.

📄 License

MIT © SylphxAI

🔗 Links