tpmjs design system

The comprehensive design system for TPMJS. This guide covers design principles, foundations, components, and governance rules that scale across teams, AI agents, and external contributors.

v2.0
wcag aa
dark mode
table of contents

Foundations

Systems

Implementation

Patterns

Governance

1. design principles

These principles guide every design decision in TPMJS. They ensure consistency and prevent drift as the system grows.

clarity over decoration

Every element serves a purpose. Remove anything that doesn't help users accomplish their goals. Developer tools should feel efficient, not playful.

mechanical precision

Sharp corners communicate precision and control. Tools feel engineered, not organic. The interface should feel like a well-built instrument.

copper = active signal

The copper accent (#A6592D) indicates interactivity and importance. It's the 'hot metal' that draws attention to actions and key information.

generous whitespace

Reduce cognitive load through breathing room. Dense interfaces slow users down. Space creates hierarchy and improves scanability.

accessible by default

WCAG AA compliance is the minimum. Focus states are never removed. Color is never the only indicator of meaning.

developer-first

The system is built for developers using developer tools. Technical accuracy over marketing speak. Show don't tell.

design philosophy

TPMJS is a developer platform for AI tools. The design reflects this through industrial aesthetics: sharp edges, technical typography, and a muted palette with copper as the signal color.

Unlike consumer products that aim for delight, TPMJS aims for efficiency and trust. Users should feel confident that the interface will behave predictably and help them accomplish tasks quickly.

2. color system

A warm earthy palette with copper accent. Colors are designed for clarity, hierarchy, and accessibility.

backgrounds

bg
#F5F3F0
base background
surface
#FFFFFF
cards, panels
surface-2
#FAF8F6
elevated surfaces
surface-3
#F0EDEA
highest elevation

borders

border
#CEC9C3
default borders
border-strong
#857F77
emphasized borders
border-subtle
#E3E0DC
subtle borders

text

text
#1A1715
primary text
text-secondary
#5C564F
secondary text
text-tertiary
#817B74
tertiary text
text-muted
#9A958F
muted text

accent (copper)

accent
#A6592D
brand accent
accent-strong
#8F4722
hover accent
accent-muted
#EDE5DF
soft tint

status

success
#327D52
success states
warning
#D9A020
warning states
error
#C44545
error states
info
#3380CC
info states

status (light backgrounds)

success-light
#E5F3EC
success bg
warning-light
#F8F2E0
warning bg
error-light
#F9EDED
error bg
info-light
#EDF4FB
info bg

color usage rules

when to use copper vs neutral

  • Copper: Primary actions, active states, links, key metrics
  • Neutral: Secondary actions, borders, backgrounds, body text
  • Rule: Copper should be max ~10% of visible screen area

semantic color priority

error
>
warning
>
success
>
info

When multiple states apply, show the highest priority color.

do

Use copper for primary CTAs

don't

Don't use copper for everything

do

Use status colors with meaning

published
pending
failed
don't

Don't use colors decoratively

tools
agents
users

contrast ratios (wcag aa)

combinationrationormal textlarge text
foreground / background12.5:1
pass
pass
accent / background5.2:1
pass
pass
foreground-secondary / background5.8:1
pass
pass
foreground-tertiary / background3.9:1
large only
pass
3. typography

Two font families create clear hierarchy: monospace for headings and technical content, sans-serif for body text and descriptions.

font families

JetBrains Mono

--font-mono

Used for: headings, code, data, labels, technical content

Inter

--font-sans

Used for: body text, descriptions, long-form content

type scale

--text-xs12px / 0.75rem
Aa
--text-sm14px / 0.875rem
Aa
--text-base16px / 1rem
Aa
--text-lg18px / 1.125rem
Aa
--text-xl20px / 1.25rem
Aa
--text-2xl24px / 1.5rem
Aa
--text-3xl32px / 2rem
Aa
--text-4xl40px / 2.5rem
Aa
--text-5xl48px / 3rem
Aa

line height

--leading-tight1.2
--leading-snug1.4
--leading-normal1.6
--leading-relaxed1.7
--leading-loose1.8

max line width

--prose-width-narrow45ch
--prose-width65ch (default)
--prose-width-wide80ch

This paragraph is constrained to 65 characters per line, the optimal width for reading comprehension. Lines that are too long cause eye fatigue, while lines that are too short disrupt reading rhythm.

usage rules

monospace (JetBrains Mono)

  • • Page titles and section headings
  • • Code snippets and technical content
  • • Data values, metrics, timestamps
  • • Form labels and button text
  • • Table headers and numeric columns

sans-serif (Inter)

  • • Body paragraphs and descriptions
  • • Help text and instructions
  • • Error messages and notifications
  • • Marketing and explanatory content
  • • Long-form documentation

heading hierarchy

heading 1 (48px)

heading 2 (40px)

heading 3 (32px)

heading 4 (24px)

heading 5 (20px)
heading 6 (18px)
4. spacing

Consistent spacing creates visual rhythm. Use the 4px base unit and generous whitespace for clarity.

spacing scale

1
4px
2
8px
3
12px
4
16px
5
20px
6
24px
8
32px
10
40px
12
48px
16
64px
20
80px
24
96px
32
128px
40
160px
48
192px
64
256px

semantic spacing

--spacing-tight16px (4)
--spacing-element32px (8)
--spacing-comfortable48px (12)
--spacing-component64px (16)
--spacing-section128px (32)
5. motion

Motion communicates state changes, not decoration. Animations are fast by default and respect user preferences.

motion principles

fast by default

Most transitions complete in 150-200ms. Users should never wait for animations to finish before interacting.

state communication

Motion indicates something changed: a panel opened, an item was selected, data updated. Never animate just for visual interest.

linear for data

Data updates (counters, progress bars, charts) use linear easing. This feels more precise and mechanical.

respect preferences

Honor prefers-reduced-motion. All animations disable when the user has requested reduced motion.

duration tokens

--motion-instant0ms
--motion-fast150ms
--motion-base200ms
--motion-slow300ms
--motion-slower500ms

easing tokens

--easing-standardcubic-bezier(0.4, 0, 0.2, 1)
--easing-deceleratecubic-bezier(0, 0, 0.2, 1)
--easing-acceleratecubic-bezier(0.4, 0, 1, 1)
--easing-linearlinear
--easing-springcubic-bezier(0.175, 0.885, 0.32, 1.275)

interactive demo

6. accessibility

TPMJS targets WCAG 2.1 AA compliance. Accessibility is not optional—it's a core requirement for every component.

standards

AA

WCAG 2.1 target

4.5:1

min contrast (text)

3:1

min contrast (UI)

focus management

focus ring design

Focus rings use the copper accent color with 2px width and 2px offset. They are never removed from interactive elements.

keyboard navigation

  • Tab moves focus forward through interactive elements
  • Shift+Tab moves focus backward
  • Enter / Space activates buttons and links
  • Esc closes modals and dropdowns
  • • Arrow keys navigate within components (tabs, radios, menus)

color independence

do

Use icons + color for states

Published
Failed
don't

Don't rely on color alone

PublishedFailed

screen reader support

  • • All interactive elements have accessible names (aria-label or visible text)
  • • Images include alt text describing content
  • • Form inputs are associated with labels
  • • Error messages are announced via aria-live regions
  • • Loading states communicate progress to screen readers
  • • Decorative elements are hidden from assistive technology
7. layout & responsiveness

Mobile-first responsive design with clear breakpoints and density modes for different use cases.

breakpoints

sm640px
mobile landscape
md768px
tablet
lg1024px
desktop
xl1280px
wide
2xl1536px
ultrawide

responsive behaviors

  • Sidebar: Collapsible on mobile, visible on lg+
  • Tables: Horizontal scroll on mobile, full width on lg+
  • Cards: Single column on mobile, grid on md+
  • Navigation: Hamburger menu on mobile, horizontal on lg+

density modes

Density modes adjust spacing, font size, and row heights for different contexts. Essential for data-dense developer tools.

namedownloadsstatus
@tpmjs/parser125,432
active
@tpmjs/validator89,231
active
@tpmjs/transform45,678
beta

compact

36px rows

comfortable

48px rows

spacious

64px rows

grid system

12-column grid

1
2
3
4
5
6
7
8
9
10
11
12

sidebar + content (3 + 9)

sidebar
main content
8. content guidelines

Voice and tone guidelines for consistent, helpful communication across the platform.

voice & tone

we are

  • Technical: Precise, accurate, developer-friendly
  • Direct: Say what needs to be said, no fluff
  • Helpful: Guide users to success
  • Neutral: Professional, not corporate

we are not

  • Marketing-speak: No "revolutionary" or "game-changing"
  • Cute: No jokes, puns, or playful language
  • Vague: No "something went wrong"
  • Condescending: No "simply" or "just"

microcopy rules

do

Use action verbs for buttons

don't

Avoid generic labels

error message format

Error messages should explain what happened and what to do next.

Good: "API key is invalid. Generate a new key in your dashboard settings."
Bad: "Error: Invalid credentials"

empty states

no tools yet

Publish your first tool to get started.

no results found

Try adjusting your search or filters.

failed to load

Check your connection and try again.

loading states

skeleton loading

Use for content that will load quickly (<2s).

spinner loading

Use for actions or longer operations.

Loading...
publishing tool...
9. data visualization

Guidelines for charts, metrics, and data displays. Semantic colors only— no rainbow charts.

data color palette

primary data

secondary data

tertiary data

baseline

color rules for data

  • • Use copper for primary/highlighted data series
  • • Use grayscale for comparison and secondary series
  • • Reserve semantic colors (success/warning/error) for threshold indicators
  • • Create emphasis through opacity variation, not hue changes
  • • Maximum 4 colors in any single visualization

quality score visualization

Tool quality scores use a consistent visual language across the platform.

0%
excellent
0%
good
0%
fair
0%
poor

progress indicators

primary (default)

success (completion)

warning (approaching limit)

danger (at limit)

animated counters

0

downloads

0

users

0

tools

0%

uptime

10. iconography

Consistent icon usage for clear visual communication.

icon sizes

xs (12px)

sm (16px)

md (20px)

lg (24px)

usage rules

icon-only buttons

Only allowed when the action is universally understood (close, search, menu) AND space is limited.

icon + label (preferred)

Always include text labels when space permits for clarity.

semantic icons

success
warning
error
info

all icons

copy
github
check
x
chevronDown
chevronRight
clock
link
sun
moon
discord
menu
folder
plus
trash
edit
search
loader
upload
alertCircle
globe
terminal
puzzle
message
key
info
send
home
user
heart
star
externalLink
arrowLeft
box
alertTriangle
11. theming

Theme architecture and customization guidelines for consistent extension.

token architecture

core
Raw values: HSL colors, pixel sizes, timing functions
semantic
Named tokens: --primary, --background, --motion-fast
component
Component-specific: button-bg, input-border, card-shadow
/* Core tokens (don't override) */
--copper-500: 22 57% 41%;

/* Semantic tokens (safe to override) */
--primary: var(--copper-500);
--primary-hover: 22 57% 35%;
--accent: var(--primary);

/* Component tokens (for advanced customization) */
--button-bg: hsl(var(--primary));
--button-hover-bg: hsl(var(--primary-hover));

dark mode

Dark mode is opt-in via the .dark class on the root element. All semantic tokens have dark mode variants.

light mode

dark mode

embedding guidance

for sdk users embedding tpmjs ui

  • • Import the CSS variables from @tpmjs/ui/styles
  • • Override semantic tokens in your own CSS to match your brand
  • • Do not override core tokens (raw values)
  • • Test both light and dark modes if supporting theme switching
  • • Use data-density attribute for density control
12. components

Complete component catalog with all variants and states.

button

variants

sizes

states

badge

variants

default
secondary
outline
success
error
warning
info

sizes

small
medium
large

card

default card

card variant example

card content goes here.

elevated card

card variant example

card content goes here.

outline card

card variant example

card content goes here.

blueprint card

card variant example

card content goes here.

featured card

card variant example

card content goes here.

brutalist card

card variant example

card content goes here.

accordion

breadcrumbs

form elements

checkbox

switch

radio group

slider

Value: 50

progress bar

25%

50%

75%

100%

tabs

table

example data table
namecategorydownloadsscore
@tpmjs/parserutility125,4320.92
@tpmjs/validatorvalidation89,2310.87
@tpmjs/transformdata45,6780.81

pagination

dropdown menu

popover

tooltip

modal

drawer

spinner

Loading...

xs

Loading...

sm

Loading...

md

Loading...

lg

Loading...

xl

skeleton

state components

empty state

No items yet

Get started by creating your first item.

error state

Something went wrong

Failed to load data. Please try again.

loading state

Loading...
Loading data...

page header

Page Title

This is a description of the page content.

stat card

0
Total Tools
+12% from last month
0K
Downloads
-3% from last month
0
Users
No change

quality score

1
Poor

excellent

1
Poor

good

1
Poor

average

0
Poor

poor

install snippet

npm install @tpmjs/example-tool

toast

Toast variants: default, success, error, warning, info

code block

import { Button } from '@tpmjs/ui/Button/Button';

export function MyComponent() {
  return (
    <Button variant="default">
      click me
    </Button>
  );
}
13. component apis

Complete API documentation for each component with props, types, and usage examples.

button api

proptypedefaultdescription
variant'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'link''default'visual style
size'sm' | 'md' | 'lg' | 'icon''md'button size
loadingbooleanfalseshow spinner
disabledbooleanfalsedisable interaction
// Basic usage
<Button>click me</Button>

// With variant and size
<Button variant="destructive" size="lg">
  delete tool
</Button>

// Loading state
<Button loading>publishing...</Button>

// With icon
<Button>
  <Icon icon="plus" size="sm" className="mr-2" />
  add tool
</Button>

input api

proptypedefaultdescription
state'default' | 'error' | 'success''default'visual state
size'sm' | 'md' | 'lg''md'input size
// Basic usage
<Input placeholder="enter text..." />

// With error state
<Input
  state="error"
  placeholder="invalid input"
/>

// With FormField wrapper
<FormField
  label="Email"
  error="Invalid email address"
>
  <Input state="error" />
</FormField>

anti-patterns

don't do this

// ❌ Using inline styles
<Button style={{ backgroundColor: 'red' }}>
  delete
</Button>

// ❌ Nesting buttons
<Button>
  <Button>nested</Button>
</Button>

// ❌ Missing accessible name
<Button size="icon">
  <Icon icon="plus" />
</Button>

do this instead

// ✅ Using variants
<Button variant="destructive">
  delete
</Button>

// ✅ Single button
<Button>action</Button>

// ✅ With aria-label
<Button size="icon" aria-label="Add item">
  <Icon icon="plus" />
</Button>
15. form patterns

Consistent form patterns for data entry, validation, and submission. Forms should guide users through tasks with clear feedback.

validation timing

Choose validation timing based on the field type and user expectations.

validate on blur

Best for: format validation, required fields

validate on submit

Best for: async validation, complex rules

We'll check if this name is available

error summary

For forms with multiple errors, show a summary at the top.

help text placement

do

Help text below the input

You can find this in your dashboard settings
don't

Don't put help text above

You can find this in your dashboard settings

required vs optional

when most fields are required

(optional)

when most fields are optional

required

Rule: Mark the minority. If most fields are required, mark optional fields. If most are optional, mark required fields.

field grouping

Group related fields with visual hierarchy.

package details

author information

repository

danger zone

Destructive actions require explicit confirmation.

danger zone

delete this tool

Once deleted, this tool cannot be recovered.

transfer ownership

Transfer this tool to another user or organization.

16. feedback patterns

Feedback patterns communicate status, progress, and system responses. Choose the right pattern based on context and urgency.

feedback decision tree

Q1

Is this a page-level system message?

Yes → Use Banner (maintenance, outage, announcement)

Q2

Is it a response to a user action?

Yes → Use Toast (save, submit, delete confirmation)

Q3

Is it contextual to a specific element?

Yes → Use Inline Alert (form errors, field hints)

toast notifications

Ephemeral messages that appear briefly and auto-dismiss.

tool published

@tpmjs/parser v1.0.0 is now live

publish failed

Package validation errors. Check your config.

api rate limit

You've used 90% of your monthly quota

new version available

Refresh to get the latest features

toast guidelines

  • • Auto-dismiss after 5 seconds (except errors)
  • • Errors should require manual dismissal
  • • Stack from bottom-right, newest at bottom
  • • Maximum 3 visible toasts at once

inline alerts

Persistent messages within content flow.

verification complete

Your email has been verified. You can now publish tools.

deprecated package

This package is deprecated. Consider migrating to @tpmjs/v2.

critical security issue

This version has known vulnerabilities. Update immediately.

global banners

System-wide announcements that span the full width.

Scheduled maintenance: Jan 15, 2-4am UTC. Some services may be unavailable.
Service degradation detected. Some API calls may fail. We are investigating.
status page
New: AI-powered code review is now available for all tools!

progress indicators

For long-running operations, show determinate progress when possible.

determinate progress

Use when you can calculate progress (file upload, batch processing).

uploading package.tgz67%

indeterminate progress

Use when duration is unknown (API calls, processing).

Loading...
validating package...

retry patterns

When operations fail, provide clear retry options.

failed to load tools

We couldn't connect to the server. This could be a network issue or the service may be temporarily unavailable.

17. table patterns

Data table patterns for displaying, sorting, filtering, and acting on tabular data.

sortable columns

Click column headers to sort. Show sort direction with icons.

name
category
downloads
score
@tpmjs/parserutility125,4320.92
@tpmjs/validatorvalidation89,2310.87
@tpmjs/transformdata45,6780.81

row selection + bulk actions

Select rows to enable bulk actions. Show action bar when rows are selected.

namecategorystatusdownloads
@tpmjs/parserutility
active
125,432
@tpmjs/validatorvalidation
active
89,231
@tpmjs/transformdata
beta
45,678
@tpmjs/executorruntime
active
34,521
@tpmjs/configutility
deprecated
23,456

pagination

Use pagination for large datasets. Show page info and navigation.

full pagination

simple pagination

minimal pagination

empty & loading states

no tools found

Try adjusting your filters or create your first tool.

namecategorydownloads

density integration

Tables respect the page density mode for compact views.

row heights by density

compact

36px

comfortable

48px

spacious

64px

18. search & filtering

Search and filter patterns help users find content quickly. Design for progressive disclosure and instant feedback.

search box states

Search boxes should show clear states and provide helpful feedback.

default

active / has value

loading

no results

No results found

filter chips

Use chips to show active filters with easy removal.

category: utility
status: active
downloads: >10k

showing 42 of 128 tools

filter panel

For complex filtering, use a dedicated panel with grouped options.

filters

results area

@tpmjs/parser
active
@tpmjs/validator
active
@tpmjs/transform
active

saved views

Allow users to save and recall filter combinations.

saved views
3

query syntax display

For power users, display the underlying query syntax.

query
category:utility AND status:active AND downloads:>10000

Tip: Use this syntax directly in the search box for quick filtering.

command palette

Quick access to search and navigation via keyboard shortcut.

recent

actions

↑↓ navigate selectesc close
⌘Kto open command palette
19. accessibility checklists

Component-level accessibility requirements and implementation guides. All components follow WCAG 2.1 AA standards.

aria patterns & keyboard

Each component has specific ARIA patterns and keyboard interactions that must be implemented.

overlay components

componentaria patternfocus trapkeyboardreduced motion
Modaldialog
yes
Esc (close)
Tab (cycle focus)
Instant open/close
Drawerdialog
yes
Esc (close)
Tab (cycle focus)
No slide animation
Popoverdialog
no
Esc (close)
Tab (move to next)
Instant show/hide
Tooltiptooltip
no
Focus trigger (show)
Blur (hide)
Instant show/hide
DropdownMenumenu
no
Enter/Space (select)
Arrow keys (navigate)
Esc (close)
Instant show/hide
Toastalert / status
no
Focus action button
Enter (action)
No slide animation

form components

componentaria patternfocus trapkeyboardreduced motion
Inputtextbox
no
Tab (focus)
Type (input)
N/A
Selectlistbox
no
Enter/Space (open)
Arrow keys (navigate)
Esc (close)
Instant show/hide
Checkboxcheckbox
no
Space (toggle)
Tab (focus)
N/A
Radioradiogroup
no
Arrow keys (select)
Tab (focus)
N/A
Switchswitch
no
Space (toggle)
Tab (focus)
Instant toggle
Sliderslider
no
Arrow keys (adjust)
Home/End (min/max)
N/A

navigation components

componentaria patternfocus trapkeyboardreduced motion
Tabstablist
no
Arrow keys (navigate)
Enter/Space (select)
Home/End (first/last)
N/A
Breadcrumbsnavigation
no
Tab (focus links)
Enter (activate)
N/A
Paginationnavigation
no
Tab (focus)
Enter (activate)
N/A
Accordionregion
no
Enter/Space (toggle)
Tab (focus)
Instant expand/collapse

focus management

Proper focus management is critical for keyboard and screen reader users.

focus trap required

  • Modal dialogs - trap focus inside
  • Drawer sheets - trap until closed
  • Full-screen overlays

focus restoration

  • Return focus to trigger on close
  • Save and restore focus position
  • Skip links for long content

implementation pattern

// Focus trap implementation
const dialogRef = useRef<HTMLDivElement>(null);
const triggerRef = useRef<HTMLButtonElement>(null);

// Save trigger reference before opening
const handleOpen = () => {
  triggerRef.current = document.activeElement as HTMLButtonElement;
  setOpen(true);
};

// Restore focus on close
const handleClose = () => {
  setOpen(false);
  triggerRef.current?.focus();
};

screen reader announcements

Use live regions to announce dynamic content changes.

aria-live regions

aria-live="polite"

Toast notifications, status updates

aria-live="assertive"

Error messages, critical alerts

role="status"

Loading states, progress updates

component announcements

eventannouncement
Toast shown"[message content]"
Modal opened"[dialog title], dialog"
Form error"Error: [field name], [error message]"
Loading complete"Loading complete, [N] results"

color contrast requirements

All text must meet WCAG AA contrast requirements (4.5:1 for normal text, 3:1 for large text).

foreground on background
9.2:1
secondary on surface
5.8:1
tertiary on surface
4.5:1

contrast verification

  • • Test all color combinations in both themes
  • • Verify focus indicators (3:1 minimum)
  • • Ensure error states meet requirements
  • • Check interactive state contrast changes

reduced motion support

Respect the prefers-reduced-motion media query for users who experience motion sickness or vestibular disorders.

implementation

// CSS approach
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

// React hook approach
import { useReducedMotion } from '@tpmjs/ui/system/hooks/useReducedMotion';

function AnimatedComponent() {
  const prefersReducedMotion = useReducedMotion();

  return (
    <div
      className={prefersReducedMotion ? 'instant' : 'animated'}
    />
  );
}

always animate

Progress bars, loading spinners

respect preference

Page transitions, modal animations

never animate

Auto-playing video, parallax

testing checklist

Before shipping any component, verify accessibility with these tests.

keyboard testing

  • Tab through all interactive elements
  • Verify focus is visible at all times
  • Test Enter/Space activation
  • Verify Escape closes overlays
  • Test arrow key navigation

screen reader testing

  • Test with VoiceOver (macOS/iOS)
  • Test with NVDA (Windows)
  • Verify all content is announced
  • Check landmark navigation
  • Test live region updates
20. content & writing

Consistent language and terminology across the platform. These guidelines ensure clarity for users and maintainability for developers.

glossary

Use these terms consistently throughout the platform.

termdefinitionavoid
ToolA reusable MCP server or utility that can be installed via npmPackage, Module, Plugin
AgentAn AI-powered assistant that uses tools to complete tasksBot, Assistant, AI
CollectionA curated group of related toolsBundle, Set, Kit
PublishRelease a new version to the registryDeploy, Ship, Push
InstallAdd a tool to your project dependenciesDownload, Get, Add
ExecuteRun a tool with specific parametersInvoke, Call, Trigger

verb consistency

Use these verbs for common actions to maintain consistency.

actionuseavoid
Remove permanently
Delete
Remove, Erase, Destroy
Remove from list
Remove
Delete, Drop, Clear
Cancel access
Revoke
Remove, Delete, Cancel
Make inactive
Disable
Turn off, Deactivate
Make active
Enable
Turn on, Activate
Start new
Create
Add, New, Make
Change existing
Edit
Modify, Update, Change
Look at details
View
See, Show, Open

capitalization

Follow these capitalization rules for UI text.

do

Lowercase for UI elements

create tool
view details
my collections
don't

Avoid title case in buttons

Create Tool
View Details
My Collections

exceptions

  • • Proper nouns: "GitHub", "Anthropic", "Claude"
  • • Product names: "TPMJS", "MCP"
  • • Start of sentences in paragraphs

numbers & formatting

Format numbers and data consistently.

numbers

Small:1, 42, 100
Large:1,234
Abbreviated:12.5k, 1.2M

dates

Full:Jan 15, 2025
Relative:2 hours ago
ISO:2025-01-15

units

Bytes:2.4 MB
Duration:3m 24s
Version:v1.2.3

error messages

Write error messages that are helpful and actionable.

do

Helpful and specific

Invalid email format

Please enter a valid email address like user@example.com

Tool name already exists

Choose a different name or update the existing tool

don't

Vague or technical

Invalid input

Error: EEXIST

Something went wrong

21. icon system

Icons from Lucide React, used consistently across components. All icons use 2px stroke weight and are available in multiple sizes.

icon library

Source: Lucide React. Icons should be imported from @tpmjs/ui/Icon/Icon.

common icons

check
x
alertCircle
alertTriangle
info
loader
search
edit
chevronRight
chevronDown
plus
moreHorizontal

icon sizes

Choose icon size based on context and surrounding content.

xs (12px)

Inline, tight spaces

sm (16px)

Buttons, inputs

md (20px)

Default, nav items

lg (24px)

Empty states, hero

icon usage guidelines

When and how to use specific icons.

iconusagerecommended size
check
Success, completion, enabled
sm-md
x
Close, cancel, remove, disabled
sm-md
alertCircle
Error, critical issue
sm-md
alertTriangle
Warning, caution needed
sm-md
info
Information, help
sm-md
loader
Loading, processing
sm-md
search
Search input, find action
sm
edit
Edit, configuration
sm-md
chevronRight
Navigate forward, expand
xs-sm
chevronDown
Expand, dropdown
xs-sm
plus
Add, create new
sm-md
moreHorizontal
More options menu
sm

icon styling

Consistent styling rules for icons in different contexts.

colors

Success states
Error states
Warning states
Information
Neutral/default

with text

2 hours ago

adding new icons

Process for adding new icons to the system.

  1. 1.Check if a suitable icon exists in Lucide
  2. 2.Add the icon import to packages/ui/src/Icon/icons.ts
  3. 3.Add the icon name to the IconName type
  4. 4.Document the usage in this style guide

example: adding a new icon

// icons.ts
import { Heart } from 'lucide-react';

export const icons = {
  // ...existing icons
  heart: Heart,
};

export type IconName = keyof typeof icons;

tpmjs design system v2.0

built with @tpmjs/ui • inspired by turbopuffer.com