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

tinky-alert

v1.1.0

Published

Beautiful alert components for terminal UIs

Readme

tinky-alert

A React-like alert component library for building beautiful terminal UIs.

npm license TypeScript

tinky-alert provides a fully-featured alert component for terminal applications built with the tinky framework. It supports four semantic variants with automatic color mapping and icon selection via tinky-figures.

Features

  • 📝 Simple API - Intuitive JSX-based syntax for displaying alerts
  • 🎨 Themeable - Full integration with tinky-theme
  • 🎯 Type Safe - Built with TypeScript for excellent developer experience
  • 🧪 Well Tested - Comprehensive test coverage with unit and integration tests
  • 📚 Documented - Complete API documentation generated with TypeDoc
  • ✨ Four Variants - info, success, error, and warning with semantic meanings

Installation

npm install tinky-alert
# or
bun add tinky-alert
# or
yarn add tinky-alert

Quick Start

import { render } from "tinky";
import { Alert } from "tinky-alert";

function App() {
  return (
    <Alert variant="info" title="Information">
      This is an informational message
    </Alert>
  );
}

render(<App />);

Usage

Basic Alert

Create a simple alert message:

import { Alert } from "tinky-alert";

<Alert variant="success">Operation completed successfully</Alert>;

Alert with Title

Add a title for better visual hierarchy:

import { Alert } from "tinky-alert";

<Alert variant="error" title="Error">
  Failed to connect to the server
</Alert>;

All Variants

Use the four semantic variants for different message types:

<Alert variant="info" title="Info">
  General information message
</Alert>

<Alert variant="success" title="Success">
  Your changes have been saved
</Alert>

<Alert variant="error" title="Error">
  Something went wrong
</Alert>

<Alert variant="warning" title="Warning">
  Please review your settings
</Alert>

Theme Integration

Integrate with the tinky-theme system:

import { ThemeProvider, defaultTheme, extendTheme } from "tinky-theme";
import { Alert } from "tinky-alert";

// Using default theme
<ThemeProvider theme={defaultTheme}>
  <Alert variant="success">Success message</Alert>
</ThemeProvider>;

// Using custom theme
const customTheme = extendTheme(defaultTheme, {
  components: {
    Alert: {
      styles: {
        container: () => ({
          borderStyle: "double",
        }),
      },
    },
  },
});

<ThemeProvider theme={customTheme}>
  <Alert variant="info">Custom styled alert</Alert>
</ThemeProvider>;

API Documentation

For complete API documentation, type definitions, and usage examples, visit the API Docs.

Component

Alert

The main alert component for displaying messages in terminal UIs.

Props:

| Property | Type | Required | Description | | ---------- | --------------------------------------------- | -------- | -------------------------------- | | children | ReactNode | Yes | The message content to display | | variant | "info" \| "success" \| "error" \| "warning" | Yes | Alert variant for styling | | title | string | No | Optional title above the message |

Example:

<Alert variant="success" title="Success">
  Operation completed
</Alert>

Variants

info

Informational messages with blue border and ℹ icon.

Characteristics:

  • Blue border color
  • Information icon (ℹ, fallback: i)
  • Used for general information or neutral messages

Example:

<Alert variant="info" title="Info">
  System maintenance scheduled for tonight
</Alert>

success

Success messages with green border and ✔ icon.

Characteristics:

  • Green border color
  • Success/checkmark icon (✔, fallback: √)
  • Used for successful operations or confirmations

Example:

<Alert variant="success" title="Success">
  Your changes have been saved
</Alert>

error

Error messages with red border and ✘ icon.

Characteristics:

  • Red border color
  • Error/cross icon (✘, fallback: ×)
  • Used for error messages or failure notifications

Example:

<Alert variant="error" title="Error">
  Unable to reach the server
</Alert>

warning

Warning messages with yellow border and ⚠ icon.

Characteristics:

  • Yellow border color
  • Warning icon (⚠, fallback: ‼)
  • Used for warning messages or cautionary notes

Example:

<Alert variant="warning" title="Warning">
  Your session will expire in 5 minutes
</Alert>

Theme Configuration

AlertTheme

Type definition for the Alert theme configuration.

Properties:

| Property | Type | Description | | -------- | -------- | -------------------------------- | | styles | Object | Style functions for each element |

Style Functions:

  • styles.container(props) - Styles for the alert container
  • styles.iconContainer() - Styles for the icon wrapper
  • styles.icon(props) - Styles for the icon text
  • styles.content() - Styles for the content wrapper
  • styles.title() - Styles for the title text
  • styles.message() - Styles for the message text

Example:

import { alertTheme } from "tinky-alert";

const { styles } = alertTheme;
const containerStyles = styles.container({ variant: "success" });
// containerStyles === { flexGrow: 1, borderStyle: "round", borderColor: "green", gap: 1, paddingX: 1 }

Icons are resolved in the Alert component through tinky-figures (info, tick, cross, warning) instead of theme config.

Visual Examples

Info Alert

┌──────────────────────────┐
│ ℹ  Information         │
│   This is an info      │
│   message for users    │
└──────────────────────────┘

Success Alert

┌──────────────────────────┐
│ ✔  Success             │
│   Your operation       │
│   completed            │
└──────────────────────────┘

Error Alert

┌──────────────────────────┐
│ ✘  Error               │
│   Failed to connect    │
│   to server            │
└──────────────────────────┘

Warning Alert

┌──────────────────────────┐
│ ⚠  Warning             │
│   Your session will    │
│   expire soon          │
└──────────────────────────┘

Development

Setup

# Install dependencies
bun install

# Run tests
bun run test

# Build the project
bun run build

# Lint code
bun run lint

# Generate documentation
bun run docs

Related Packages

Acknowledgments

  • ink-ui - Inspiration for Alert component by Vadim Demedes

License

MIT © ByteLand Technology Limited