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

@times-design-system/components-react

v1.19.1

Published

Times Design System components

Readme

@times-design-system/components-react

React component library for the Times Design System. Provides a collection of accessible, production-ready UI components with semantic token integration and multiple export patterns for optimal tree-shaking.

Installation

yarn add @times-design-system/components-react @times-design-system/theme-css

react and react-dom (18 or 19) are peer dependencies.

Load the component styles and a theme once, at the root of your app:

import '@times-design-system/theme-css/variables.css'; // tokens, typography utilities, fonts
import '@times-design-system/components-react/styles.css'; // component styles

Quick Start

Import All Components

import {
  Button,
  Input,
  Link,
  Toast
} from '@times-design-system/components-react';

export function App() {
  return (
    <Button intent="primary" size="large">
      Click me
    </Button>
  );
}

Tree-Shakeable Imports

For better bundle optimization, import individual components:

import { Button } from '@times-design-system/components-react/Button';
import { Input } from '@times-design-system/components-react/Input';
import { IconButton } from '@times-design-system/components-react/IconButton';

Available Components

AdContainer, Banner, Button, ButtonContainer, Checkbox, CheckboxList, CheckboxListItem, Chip, DialogBox, Divider, Dropdown, DropdownMenu, Grid, GridItem, Icon, IconButton, Image, Input, InputHelperMessage, Label, Link, ListItem, Switch, Tab, TabGroup, Tag, Text, Toast, Tooltip.

Each is also available as a subpath, e.g. @times-design-system/components-react/Button.

Icons

Icon props (iconName, iconLeft, iconRight, leftIcon, rightIcon, icon) accept either an icon component or a registered icon name. Only the handful of icons the components use internally are registered by default, so your bundle contains just the icons you use.

import { Button, registerIcons } from '@times-design-system/components-react';
import Search from '@times-design-system/icons/filled_search';
import ArrowRight from '@times-design-system/icons/filled_arrow_right';

// Pass a component…
<Button iconLeft={Search} label="Search" />;

// …or register names once at startup and keep using strings
registerIcons({ filled_search: Search, filled_arrow_right: ArrowRight });
<Button
  iconLeft="filled_search"
  iconRight="filled_arrow_right"
  label="Search"
/>;

To make every icon name available (the pre-2.0 behaviour, adds the full icon set — about 650 KB gzipped — to your bundle):

import '@times-design-system/components-react/icons-all';

Component Examples

Button

import { Button } from '@times-design-system/components-react/Button';

// Standard button
<Button intent="primary" size="large">
  Submit
</Button>

// Button with icons
<Button iconLeft="filled_arrow_left" iconRight="filled_arrow_right">
  Navigate
</Button>

// Button as link
<Button href="/page" target="_blank">
  Learn More
</Button>

// Different intents
<Button intent="primary">Primary</Button>
<Button intent="secondary">Secondary</Button>
<Button intent="negative">Delete</Button>

// Different states
<Button state="hover">Hover</Button>
<Button state="disabled">Disabled</Button>
<Button state="loading">Loading</Button>

IconButton

import { IconButton } from '@times-design-system/components-react/IconButton';

// Icon button
<IconButton iconName="filled_add" ariaLabel="Add item" />

// As link
<IconButton
  href="https://example.com"
  iconName="filled_arrow_right"
  target="_blank"
/>

// Different sizes and intents
<IconButton size="small" intent="primary" />
<IconButton size="large" intent="secondary" />

Input

import { Input } from '@times-design-system/components-react/Input';

<Input type="text" placeholder="Enter text..." disabled={false} />;

Text

import { Text } from '@times-design-system/components-react/Text';

<Text variant="heading" size="large">
  Heading
</Text>
<Text variant="body">
  Body text
</Text>

Component Props

All components follow the Times Design System guidelines:

Common Props

  • intent: 'primary' | 'secondary' | 'negative' - Visual style variant
  • size: 'small' | 'medium' | 'large' - Component size
  • state: 'base' | 'hover' | 'pressed' | 'loading' | 'disabled' | 'focus' - Interaction state
  • disabled: boolean - Disabled state
  • className: string - Additional CSS classes

Link Support

Button and IconButton support link rendering:

  • href: string - URL to navigate to
  • target: '_blank' | '_self' | '_parent' | '_top' - Link target
  • rel: string - Link relationship (auto-set for security when needed)

Styling

Components render tds-* class names. Their styles ship as a single stylesheet, @times-design-system/components-react/styles.css, which must be imported once (see Installation). Nothing is injected at runtime, so styles work with server rendering and strict Content Security Policies.

Colours, typography and spacing come from CSS custom properties supplied by @times-design-system/theme-css.

Accessibility

All components follow WAI-ARIA standards:

  • Semantic HTML elements (button, a, input, etc.)
  • ARIA labels and roles where appropriate
  • Keyboard navigation support
  • Focus management
  • Loading and disabled states properly announced
<IconButton iconName="filled_add" ariaLabel="Add new item" />

TypeScript Support

Full TypeScript support with exported interfaces:

import {
  Button,
  type ButtonProps
} from '@times-design-system/components-react/Button';

interface MyComponentProps extends ButtonProps {
  customProp?: string;
}

export const MyComponent: React.FC<MyComponentProps> = (props) => {
  return <Button {...props} />;
};

Development

Building

npm run build

Generates:

  • ES modules in dist/
  • CommonJS bundles for Node.js
  • TypeScript declarations
  • Shared code chunks for deduplication

This build is then published to npm (https://www.npmjs.com/package/@times-design-system/components-react), where components can be installed to your codebase as a using versioned dependency; e.g. "@times-design-system/components-react": "1.0.0"

Development Server

npm run dev

Watches source files and rebuilds on changes.

Testing

npm run test

Package Structure

The package uses modern module resolution:

  • ES Modules: dist/Component/Component.js
  • CommonJS: dist/Component/Component.cjs
  • Type Definitions: dist/Component/Component.d.ts (ESM) and .d.cts (CommonJS)
  • Styles: dist/index.css, exported as ./styles.css
  • Shared Dependencies: dist/shared/* (deduplicated code)

react, react-dom and @times-design-system/icons are never bundled. The exports map is generated from the component folders by scripts/react-components/sync-exports.mjs; add a component by creating src/<Name>/<Name>.tsx, exporting it from src/index.ts and running that script.

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

This package is part of the Times Design System. For contribution guidelines, see the main repository README.

License

ISC