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-typography

v3.0.6

Published

TCN UI Typography Component Library

Readme

@tcn/ui-typography

A comprehensive typography system that provides consistent text components with proper semantic markup, accessibility features, and design system integration for React applications.

Overview

@tcn/ui-typography provides a complete set of typography components that ensure consistent text styling and proper semantic structure across your application. These components follow typography best practices and integrate seamlessly with the Blackcat UI design system.

What's Included

Text Components

  • Title: Semantic heading components (h1, h2, h3) with size variants
  • Headline: Large display text for page headers and main content
  • Subheadline: Secondary headings and section titles
  • BodyText: Main content text with various emphasis levels
  • Callout: Highlighted text for important information
  • Footnote: Small text for references and additional information
  • Caption: Descriptive text for images, forms, and UI elements

Typography Features

  • Semantic Markup: Proper HTML structure for accessibility
  • Size Variants: Consistent sizing scale (xs, sm, md, lg, xl)
  • Emphasis Levels: Normal, strong, and weak text emphasis
  • Hierarchy System: Primary, secondary, and tertiary text importance
  • Responsive Design: Text that adapts to different screen sizes

Key Features

  • Semantic HTML: Proper heading hierarchy and text structure
  • 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

Usage

Title Components

import { Title } from '@tcn/ui-typography';

function PageHeader() {
  return (
    <div>
      <Title size="lg" hierarchy="primary">
        Main Page Title
      </Title>
      <Title size="md" hierarchy="secondary">
        Section Heading
      </Title>
      <Title size="sm" hierarchy="tertiary">
        Subsection Title
      </Title>
    </div>
  );
}

Body Text

import { BodyText } from '@tcn/ui-typography';

function ArticleContent() {
  return (
    <div>
      <BodyText size="lg" emphasis="strong">
        This is the main article content with strong emphasis.
      </BodyText>

      <BodyText size="md" hierarchy="secondary">
        Regular body text for paragraphs and content.
      </BodyText>

      <BodyText size="sm" emphasis="weak" hierarchy="tertiary">
        Smaller text for less important information.
      </BodyText>
    </div>
  );
}

Callout Text

import { Callout } from '@tcn/ui-typography';

function ImportantNotice() {
  return (
    <Callout
      size="md"
      emphasis="strong"
      hierarchy="primary"
    >
      This is important information that needs attention.
    </Callout>
  );
}

Footnote and Caption

import { Footnote, Caption } from '@tcn/ui-typography';

function ImageWithText() {
  return (
    <div>
      <img src="example.jpg" alt="Example" />
      <Caption size="sm" hierarchy="secondary">
        Example image description
      </Caption>

      <Footnote size="xs" hierarchy="tertiary">
        * Additional information and references
      </Footnote>
    </div>
  );
}

Custom Styling

import { Title, BodyText } from '@tcn/ui-typography';

function CustomTypography() {
  return (
    <div>
      <Title
        size="lg"
        color="var(--accent-color)"
        pad="16px"
        selectable={false}
      >
        Custom Styled Title
      </Title>

      <BodyText
        size="md"
        color="#666666"
        padStart="24px"
        breakWords={true}
      >
        Custom styled body text with specific padding and word breaking.
      </BodyText>
    </div>
  );
}

Component Features

Size System

  • xs: Extra small text for captions and footnotes
  • sm: Small text for secondary information
  • md: Medium text for body content (default)
  • lg: Large text for headings and emphasis
  • xl: Extra large text for main titles

Emphasis Levels

  • normal: Standard text weight and style
  • strong: Bold or emphasized text
  • weak: Lighter or less prominent text

Hierarchy System

  • primary: Most important text in the hierarchy
  • secondary: Secondary importance text
  • tertiary: Least important text

Customization Options

  • Color Control: Custom text colors
  • Padding Options: Flexible padding control
  • Text Selection: Control over text selection behavior
  • Word Breaking: Control over word breaking behavior

Design System Integration

All components automatically integrate with:

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

Accessibility Features

  • Semantic Markup: Proper HTML structure for screen readers
  • Heading Hierarchy: Logical heading structure for navigation
  • ARIA Support: Built-in accessibility attributes
  • Screen Reader Support: Clear text structure and relationships
  • High Contrast: Designed for various visual accessibility needs

When to Use

Choose @tcn/ui-typography when you need:

  • Consistent text styling across your application
  • Proper semantic HTML structure
  • Accessible typography components
  • Text components that integrate with your design system
  • Typography that follows best practices
  • Components with built-in responsive behavior

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
  • Layout Options: Flexible padding and spacing controls

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
  • Optimized Typography: Efficient text rendering and layout

License

Apache-2.0