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

@fzdwx/ruaui

v0.1.0

Published

Pre-built UI components for Rua extensions

Readme

@fzdwx/ruaui

Pre-built React UI components for Rua extensions. This package provides a Raycast-inspired component library that allows extensions to render entire pages with integrated search and results.

Installation

bun add @fzdwx/ruaui

Features

  • Integrated Search: Search box and results in a single unified view
  • Keyboard Navigation: Full keyboard support with arrow keys, Enter, and Escape
  • Fuzzy Search: Built-in Fuse.js integration for fuzzy matching
  • Pinyin Support: Optional Chinese pinyin search support
  • Virtual Scrolling: Performant rendering of large lists using @tanstack/react-virtual
  • Form Components: Complete form system with validation
  • Navigation: Built-in view navigation system
  • TypeScript: Full type safety with TypeScript definitions

Components

List

Main list view component with integrated search and virtualized results.

import { List } from '@fzdwx/ruaui';

function MyExtension() {
  const items = [
    {
      id: '1',
      title: 'First Item',
      subtitle: 'This is a subtitle',
      icon: <Icon />,
    },
    {
      id: '2',
      title: 'Second Item',
      subtitle: 'Another subtitle',
    },
  ];

  return (
    <List
      searchPlaceholder="Search items..."
      items={items}
      onSelect={(item) => console.log('Selected:', item)}
      enablePinyin={true}
    />
  );
}

Props:

  • searchPlaceholder?: string - Placeholder text for search input
  • items?: ListItem[] - Array of items to display
  • sections?: ListSection[] - Grouped items with section headers
  • onSearch?: (query: string) => void - Callback when search changes
  • onSelect?: (item: ListItem) => void - Callback when item is selected
  • enablePinyin?: boolean - Enable Chinese pinyin search
  • isLoading?: boolean - Show loading indicator
  • emptyView?: ReactNode - Custom empty state component

Form

Form component with built-in validation and field management.

import { Form } from '@fzdwx/ruaui';

function MyForm() {
  const handleSubmit = (values) => {
    console.log('Form submitted:', values);
  };

  return (
    <Form onSubmit={handleSubmit} title="Create Todo">
      <Form.TextField name="title" label="Title" required />
      <Form.TextArea name="description" label="Description" rows={4} />
      <Form.Dropdown
        name="priority"
        label="Priority"
        items={[
          { label: 'High', value: 'high' },
          { label: 'Medium', value: 'medium' },
          { label: 'Low', value: 'low' },
        ]}
      />
      <Form.Checkbox name="done" label="Completed" />
    </Form>
  );
}

Form Fields:

  • Form.TextField - Single-line text input
  • Form.TextArea - Multi-line text input
  • Form.Dropdown - Select dropdown
  • Form.Checkbox - Checkbox input

Navigation

Navigation system for switching between views.

import { List, Form, useNavigation, NavigationProvider } from '@fzdwx/ruaui';

function App() {
  return (
    <NavigationProvider>
      <TodoList />
    </NavigationProvider>
  );
}

function TodoList() {
  const { push } = useNavigation();

  const items = todos.map((todo) => ({
    id: todo.id,
    title: todo.title,
    actions: [
      {
        id: 'edit',
        title: 'Edit',
        onAction: () => push(<EditForm todo={todo} />),
      },
    ],
  }));

  return <List items={items} onSelect={(item) => console.log(item)} />;
}

ActionPanel

Action buttons with keyboard shortcuts.

import { ActionPanel } from '@fzdwx/ruaui';

const actions = [
  {
    id: 'save',
    title: 'Save',
    icon: <SaveIcon />,
    shortcut: { key: 's', modifiers: ['cmd'] },
    onAction: () => save(),
  },
  {
    id: 'cancel',
    title: 'Cancel',
    onAction: () => cancel(),
  },
];

<ActionPanel actions={actions} position="footer" />

Detail

Detail view for displaying content.

import { Detail } from '@fzdwx/ruaui';

function ItemDetail({ item }) {
  return (
    <Detail
      title={item.title}
      markdown={item.markdown}
      actions={[
        {
          id: 'copy',
          title: 'Copy',
          onAction: () => copyToClipboard(item.content),
        },
      ]}
    />
  );
}

Hooks

useSearch

Hook for searching items with fuzzy search and optional pinyin support.

import { useSearch } from "@fzdwx/ruaui";

const results = useSearch({
  items: myItems,
  query: searchQuery,
  enablePinyin: true,
});

useKeyboard

Hook for handling keyboard navigation.

import { useKeyboard } from "@fzdwx/ruaui";

useKeyboard({
  onArrowUp: () => decrementIndex(),
  onArrowDown: () => incrementIndex(),
  onEnter: () => selectItem(),
  onEscape: () => close(),
  enabled: true,
});

useNavigation

Hook for navigation between views.

import { useNavigation } from '@fzdwx/ruaui';

const { push, pop, canPop } = useNavigation();

push(<DetailView />);
if (canPop) pop();

Styling

The package includes CSS with design system variables. Import the styles in your extension:

import "@fzdwx/ruaui/styles";

Or if your bundler handles CSS automatically, it will be included when you import components.

Complete Example

import { useState } from 'react';
import { List, Form, useNavigation, NavigationProvider } from '@fzdwx/ruaui';

interface Todo {
  id: string;
  title: string;
  description: string;
  done: boolean;
}

function TodoExtension() {
  return (
    <NavigationProvider>
      <TodoList />
    </NavigationProvider>
  );
}

function TodoList() {
  const [todos, setTodos] = useState<Todo[]>([]);
  const { push } = useNavigation();

  const items = todos.map((todo) => ({
    id: todo.id,
    title: todo.title,
    subtitle: todo.description,
    accessories: [
      {
        text: todo.done ? '✓' : '',
      },
    ],
    actions: [
      {
        id: 'edit',
        title: 'Edit',
        onAction: () => push(<EditTodoForm todo={todo} onSave={updateTodo} />),
      },
      {
        id: 'delete',
        title: 'Delete',
        shortcut: { key: 'd', modifiers: ['cmd'] },
        onAction: () => deleteTodo(todo.id),
      },
    ],
  }));

  return (
    <List
      searchPlaceholder="Search todos..."
      items={items}
      onSelect={(item) => console.log('Selected:', item)}
      enablePinyin={true}
    />
  );
}

function EditTodoForm({ todo, onSave }: { todo: Todo; onSave: (values: any) => void }) {
  const { pop } = useNavigation();

  const handleSubmit = (values: any) => {
    onSave({ ...todo, ...values });
    pop();
  };

  return (
    <Form onSubmit={handleSubmit} title="Edit Todo">
      <Form.TextField name="title" label="Title" required />
      <Form.TextArea name="description" label="Description" rows={4} />
      <Form.Checkbox name="done" label="Completed" />
    </Form>
  );
}

export default TodoExtension;

TypeScript

All components are fully typed. Import types from the package:

import type { ListItem, ListSection, Action, FormProps } from "@fzdwx/ruaui";

License

MIT