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

@tcn/ui-feedback

v2.0.6

Published

TCN UI Feedback Component Library

Readme

@tcn/ui-feedback

A comprehensive collection of feedback components that provide users with information about system status, progress, and confirmations in React applications.

Overview

@tcn/ui-feedback provides essential components for communicating with users about application state, progress, and important actions. These components help create a responsive and informative user experience by providing clear visual feedback for various system states and user interactions.

What's Included

Status Components

  • Alert: Simple alert dialogs for important information and confirmations
  • Confirm: Confirmation dialogs with customizable actions
  • Loading: Animated loading indicators with customizable appearance

Progress Components

  • ProgressBar: Visual progress indicators with percentage display
  • Lazy: Lazy loading components for progressive content loading

Feedback Features

  • Status Indicators: Clear visual feedback for different states
  • Progress Tracking: Visual representation of operation progress
  • User Confirmations: Safe confirmation flows for important actions
  • Loading States: Professional loading animations and indicators

Key Features

  • Accessibility First: Built with ARIA attributes and screen reader support
  • Design System Integration: Seamlessly works with Blackcat UI themes and spacing
  • TypeScript Support: Full type safety with excellent IntelliSense
  • Responsive Design: Adapts to different screen sizes and orientations
  • Customizable: Extensive styling and behavior customization options
  • Performance Optimized: Efficient rendering with minimal re-renders
  • Consistent Styling: Unified visual language across all feedback components

Usage

Basic Alert

import { Alert } from '@tcn/ui-feedback';

function SuccessAlert() {
  const [showAlert, setShowAlert] = useState(false);

  return (
    <>
      <button onClick={() => setShowAlert(true)}>
        Show Success Message
      </button>

      <Alert
        open={showAlert}
        title="Success!"
        description="Your action was completed successfully."
        onAccept={() => setShowAlert(false)}
      />
    </>
  );
}

Confirmation Dialog

import { Confirm } from '@tcn/ui-feedback';
import { Button } from '@tcn/ui-actions';

function DeleteConfirmation() {
  const [showConfirm, setShowConfirm] = useState(false);

  return (
    <>
      <button onClick={() => setShowConfirm(true)}>
        Delete Item
      </button>

      <Confirm
        open={showConfirm}
        title="Confirm Deletion"
        description="Are you sure you want to delete this item? This action cannot be undone."
        actions={
          <HStack gap="12px">
            <Button onClick={() => setShowConfirm(false)}>
              Cancel
            </Button>
            <Button
              hierarchy="danger"
              onClick={() => {
                // Delete logic here
                setShowConfirm(false);
              }}
            >
              Delete
            </Button>
          </HStack>
        }
      />
    </>
  );
}

Loading Indicator

import { Loading } from '@tcn/ui-feedback';

function LoadingExample() {
  return (
    <div>
      <h3>Loading...</h3>
      <Loading
        size="24px"
        color="var(--accent-color)"
        lineCount={8}
        animationDuration={1000}
      />
    </div>
  );
}

Progress Bar

import { ProgressBar } from '@tcn/ui-feedback';

function UploadProgress() {
  const [progress, setProgress] = useState(0);

  useEffect(() => {
    const interval = setInterval(() => {
      setProgress(prev => Math.min(prev + 0.1, 1));
    }, 100);

    return () => clearInterval(interval);
  }, []);

  return (
    <ProgressBar
      message="Uploading files..."
      value={progress}
    />
  );
}

Lazy Loading

import { Lazy } from '@tcn/ui-feedback';

function LazyContent() {
  return (
    <Lazy fallback={<Loading size="32px" />}>
      <ExpensiveComponent />
    </Lazy>
  );
}

Component Features

Alert System

  • Simple Alerts: Basic information and confirmation dialogs
  • Customizable Actions: Flexible button configurations
  • Accessibility: Proper ARIA attributes and keyboard navigation
  • Responsive Design: Adapts to different screen sizes

Confirmation Dialogs

  • Flexible Actions: Custom action button layouts
  • Safe Defaults: Prevents accidental confirmations
  • Keyboard Support: Full keyboard navigation
  • Focus Management: Proper focus trapping and restoration

Loading Components

  • Customizable Animation: Configurable line count and duration
  • Size Control: Flexible sizing options
  • Color Customization: Custom colors for different contexts
  • Smooth Animations: Professional loading animations

Progress Tracking

  • Visual Progress: Clear visual representation of progress
  • Percentage Display: Accurate percentage calculations
  • Message Support: Descriptive text for context
  • Completion States: Visual feedback for completed operations

Design System Integration

All components automatically integrate with:

  • Spacing Scale: Consistent margins, padding, and gaps
  • Color System: Primary, secondary, and accent color schemes
  • Typography: Font sizes and weights that match your design
  • Scalar Support: Automatic scaling for different screen densities
  • Theme Support: Light and dark theme compatibility

Accessibility Features

  • ARIA Attributes: Proper labeling and state management
  • Screen Reader Support: Semantic markup and descriptions
  • Focus Management: Clear focus indicators and focus trapping
  • Keyboard Navigation: Full keyboard support for all interactions
  • High Contrast: Designed for various visual accessibility needs

When to Use

Choose @tcn/ui-feedback when you need:

  • User confirmation for important actions
  • Loading states and progress indicators
  • Status notifications and alerts
  • Consistent feedback patterns across your application
  • Accessible feedback components with proper ARIA support
  • Components that integrate with your design system

Customization

Components support extensive customization through:

  • CSS Custom Properties: Dynamic styling changes
  • CSS Modules: Scoped styling with design system integration
  • Props Interface: Flexible configuration through component props
  • Theme Integration: Automatic adaptation to different themes
  • Animation Options: Customizable loading and progress animations

Performance

  • Efficient Rendering: Minimal re-renders and optimized updates
  • Bundle Optimization: Tree-shakeable components for smaller bundles
  • Memory Management: Proper cleanup and event handling
  • Lazy Loading: Support for on-demand component loading
  • Animation Optimization: Smooth animations with minimal performance impact

License

Apache-2.0