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

@sylphx/solid-tui-inputs

v0.1.5

Published

Input components for solid-tui: TextInput, SelectInput, ConfirmInput, and more

Readme

@sylphx/solid-tui-inputs

Interactive input components for Solid-TUI terminal applications

npm version License: MIT

A collection of interactive input components for building terminal user interfaces with Solid-TUI. Powered by SolidJS's fine-grained reactivity for blazing-fast, responsive UIs.

📦 Installation

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

🎯 Components

TextInput

Single-line text input with cursor navigation and masking support.

Features:

  • Cursor navigation with arrow keys
  • Backspace/Delete support
  • Placeholder text
  • Password masking
  • Submit on Enter

Props:

  • value?: string - Input value
  • placeholder?: string - Placeholder text when empty
  • focus?: boolean - Auto-focus input (default: true)
  • showCursor?: boolean - Show blinking cursor (default: true)
  • mask?: string - Mask character for passwords (e.g., '*')
  • onChange?: (value: string) => void - Value change handler
  • onSubmit?: (value: string) => void - Enter key handler

Example:

import { render, Box, Text } from '@sylphx/solid-tui';
import { TextInput } from '@sylphx/solid-tui-inputs';
import { createSignal } from 'solid-js';

function App() {
  const [value, setValue] = createSignal('');

  return (
    <Box flexDirection="column">
      <Text>Enter your name:</Text>
      <TextInput
        value={value()}
        placeholder="Type here..."
        onChange={setValue}
        onSubmit={(val) => console.log('Submitted:', val)}
      />
    </Box>
  );
}

render(<App />);

SelectInput

Single-selection dropdown with keyboard navigation.

Features:

  • Arrow keys or j/k for navigation
  • Number keys for quick selection
  • Enter to confirm
  • Visual highlight on selected item

Props:

  • items: SelectInputItem<V>[] - Array of items to select from
  • initialIndex?: number - Initially selected index (default: 0)
  • onSelect?: (item: SelectInputItem<V>) => void - Selection handler
  • onHighlight?: (item: SelectInputItem<V>) => void - Highlight handler

Types:

interface SelectInputItem<V = any> {
  label: string;
  value: V;
}

Example:

import { SelectInput } from '@sylphx/solid-tui-inputs';

function ColorPicker() {
  const items = [
    { label: 'Red', value: '#ff0000' },
    { label: 'Green', value: '#00ff00' },
    { label: 'Blue', value: '#0000ff' },
  ];

  return (
    <SelectInput
      items={items}
      onSelect={(item) => console.log('Selected:', item.value)}
    />
  );
}

MultiSelect

Multi-selection list with checkbox toggles.

Features:

  • Space to toggle selection
  • Arrow keys or j/k for navigation
  • Number keys for quick toggle
  • Enter to confirm
  • Checkboxes ([x]/[ ]) for visual feedback

Props:

  • items: MultiSelectItem<V>[] - Array of items to select from
  • defaultValue?: V[] - Initially selected values
  • onSelect?: (items: MultiSelectItem<V>[]) => void - Selection handler

Types:

interface MultiSelectItem<V = any> {
  label: string;
  value: V;
}

Example:

import { MultiSelect } from '@sylphx/solid-tui-inputs';

function FruitPicker() {
  const items = [
    { label: 'Apple', value: 'apple' },
    { label: 'Banana', value: 'banana' },
    { label: 'Cherry', value: 'cherry' },
  ];

  return (
    <MultiSelect
      items={items}
      defaultValue={['apple']}
      onSelect={(selected) => console.log('Selected:', selected)}
    />
  );
}

ConfirmInput

Yes/No confirmation prompt.

Features:

  • Y/N keyboard shortcuts
  • Arrow keys for navigation
  • Enter to confirm
  • Customizable labels

Props:

  • onConfirm?: (confirmed: boolean) => void - Confirmation handler
  • yesLabel?: string - Custom "Yes" label (default: "Yes")
  • noLabel?: string - Custom "No" label (default: "No")
  • defaultValue?: boolean - Default selection (default: false)

Example:

import { ConfirmInput } from '@sylphx/solid-tui-inputs';

function DeleteConfirm() {
  return (
    <Box flexDirection="column">
      <Text>Are you sure you want to delete this file?</Text>
      <ConfirmInput
        onConfirm={(confirmed) => {
          if (confirmed) {
            console.log('Deleting...');
          }
        }}
      />
    </Box>
  );
}

QuickSearchInput

Searchable dropdown with real-time filtering.

Features:

  • Type to filter items
  • Cursor navigation within search text
  • Arrow keys for list navigation
  • Backspace/Delete for editing
  • Case-sensitive search option

Props:

  • items: QuickSearchItem<V>[] - Array of items to search
  • placeholder?: string - Search input placeholder
  • caseSensitive?: boolean - Case-sensitive search (default: false)
  • onSelect?: (item: QuickSearchItem<V>) => void - Selection handler

Types:

interface QuickSearchItem<V = any> {
  label: string;
  value: V;
}

Example:

import { QuickSearchInput } from '@sylphx/solid-tui-inputs';

function CountrySelector() {
  const countries = [
    { label: 'United States', value: 'us' },
    { label: 'United Kingdom', value: 'uk' },
    { label: 'Canada', value: 'ca' },
    // ... more countries
  ];

  return (
    <QuickSearchInput
      items={countries}
      placeholder="Search countries..."
      onSelect={(country) => console.log('Selected:', country.value)}
    />
  );
}

⌨️ Keyboard Shortcuts

Common

  • ↑/↓ or j/k - Navigate items
  • Enter - Confirm selection
  • 1-9 - Quick select/toggle item by number

TextInput / QuickSearchInput

  • ←/→ - Move cursor
  • Backspace - Delete before cursor
  • Delete - Delete after cursor

MultiSelect

  • Space - Toggle checkbox

ConfirmInput

  • y - Select Yes
  • n - Select No

🎨 Examples

Run the included examples:

npm run example:text      # TextInput demo
npm run example:select    # SelectInput demo
npm run example:multi     # MultiSelect demo
npm run example:confirm   # ConfirmInput demo
npm run example:search    # QuickSearchInput 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