SDK · React
Using TUX in React
@tti/tti-ux-react. 1. Installation
Configure your project .npmrc to resolve the @tti scope from the internal package registry:
@tti:registry=https://code.tti.tamu.edu/api/packages/tti/npm/Install the package alongside React:
npm install @tti/tti-ux-react react react-dom2. Quick Start Example
Import primitives, design token styles, and the useTuxTheme() hook directly into your components:
import React from "react";
import {
TuxButton,
TuxBadge,
TuxAlert,
TuxCard,
TuxBigStat,
useTuxTheme
} from "@tti/tti-ux-react";
import "@tti/tti-ux-react/styles.css"; // Canonical tokens + WCAG AAA reset
export default function Dashboard() {
const { theme, toggleTheme } = useTuxTheme();
return (
<div className="p-8 space-y-6">
<div className="flex justify-between items-center">
<h1 className="text-2xl font-bold">Research Dashboard</h1>
<TuxButton
shape="sharp"
intent="secondary"
size="sm"
onClick={toggleTheme}
>
Theme: {theme}
</TuxButton>
</div>
<TuxAlert variant="info" title="System Status">
All telemetry feeds are operating under WCAG 2.2 Level AAA compliance.
</TuxAlert>
<TuxCard padded>
<div className="flex items-center justify-between">
<TuxBigStat
value="126"
suffix="M"
label="Annual research expenditure"
tone="maroon"
/>
<TuxBadge tier="restricted" variant="solid">Restricted</TuxBadge>
</div>
</TuxCard>
</div>
);
}3. Theme Reactivity
TUX React components automatically respond to the data-theme attribute on <html> (tti, tti-dark, tti-hc).
The useTuxTheme() hook reads from and writes to localStorage with system-preference synchronization, ensuring persistent WCAG 2.2 Level AAA compliance across page reloads.
4. Ported Component Matrix
26 Native TSX Primitives with 100% Test Coverage
Actions & Overlays
Feedback & Status
Institutional classification badges across 4 security tiers
7:1 contrast alert callouts with live ARIA announcements
ADR-0013 operational system status (nominal to critical)
Zero-data feedback states with 5 turnkey presets
Corner ribbon and banner non-production indicators
Data & Telemetry
Elevation-aware container with subtle hover lift and focus rings
Hero KPI metric displays with trend badges and maroon tones
Before/after KPI comparisons with automatic delta calculation
High-density multi-column statistical summary block
Academic figure and table captions with citation metadata
Navigation & Content Structure
Turnkey two-tier institutional shell with header, hero, breadcrumbs, and footer
Two-tier maroon/charcoal utility bar and brand navigation ribbon
Collapsible hierarchical navigation sidebar with live search filter
Stacked sidebar module block with eyebrow, heading, and variant styling
Hierarchical page navigation with maroon origin crumb
Accessible WAI-ARIA tabs with maroon underline indicators
Accessible disclosure groups with native details/summary
Categorized resource links with external markers
Full-width section navigation bands with tone treatments
AI & Brand Primitives
5-band institutional color bar across the TTI research spectrum
Expandable AI citation pill strip with source verification cards
Collapsible chain-of-thought reasoning trace disclosure
Structured AI tool invocation card with input/output inspection
Layout & Editorial
Editorial headings with signature 2px Warm Gold underline keyline
Editorial callout boxes with brand left-rule accents
Profile identity primitive with photo and initials fallback
Accessible form field orchestrating label, hint, and error
Semantic key-value metadata list (<dl>)
Accessible loading placeholders with reduced-motion safety
Syntax-highlighted code display with copy-to-clipboard