# RJ Signal UI - Component contracts Version 1.0.0 | Reviewed 11 November 2026 | Canonical: https://rajajeevan.com/brand/#ui-kit ## Contents - [Contract and implementation rule](#contract-and-implementation-rule) - [Actions and feedback](#actions-and-feedback) - [Input and selection](#input-and-selection) - [Navigation and overlays](#navigation-and-overlays) - [Data and specialised surfaces](#data-and-specialised-surfaces) - [State coverage matrix](#state-coverage-matrix) ## Contract and implementation rule Choose one owner for behaviour per component. Native controls retain native semantics; browser components use real HTML first. For a complex web widget select React Aria OR Radix OR the primary framework's supported control, not overlapping focus managers. A token adapter may style several libraries on separate surfaces; it does not make their state, events or accessibility trees interchangeable. Each component must document purpose, anatomy, inputs, outputs, states, focus/keyboard, accessibility name, loading/error/empty behaviour, responsive layout and test evidence. Stable record IDs drive list identity; visible position is not an ID. Define controlled/uncontrolled ownership once; never duplicate state silently. ## Actions and feedback | Component | Anatomy / variants | Required contract | | --- | --- | --- | | Button | Label, optional leading icon; primary, secondary, quiet, destructive | Use verb + object; one primary action per decision region. Enter/Space activate a web button. Pending keeps size and label, disables duplicate work. Destructive action named explicitly, never merely 'OK'. | | Icon button | Icon + accessible name + optional tooltip | Name describes action, not icon shape. Tooltip is supplemental; touch users need the same meaning. Toggle exposes pressed state, not a changing unexplained glyph. | | Link | Text + optional external indicator | Navigation uses href; command uses button. Preserve browser open-in-new-tab and visited behaviour. Warn when a document download or new context is material. | | Menu / context menu | Trigger, grouped actions, separators | Menu is for actions, not form layout. Keyboard/open/close/roving focus follow platform/APG; Escape restores trigger focus. Right-click has an equivalent visible route. | | Toolbar / command bar | Primary actions, overflow, selection context | Reflow lower-priority commands into labelled overflow. Commands remain reachable by keyboard; never duplicate a destructive shortcut without confirmation/undo design. | | Status / toast | Text, optional undo or dismiss | Polite announcement for ordinary completion. Do not move focus for a toast. Critical errors persist near the task; no required action disappears on a timer. | | Banner / inline alert | Heading, detail, recovery | Severity uses words/icon plus colour. Announce newly introduced urgent errors sparingly; existing page content is not a stream of alerts. | | Progress | Task label, determinate value or indeterminate state, cancel when real | Announce meaningful milestones, not every percentage. Spinner without text is incomplete. Never show fabricated progress. | | Skeleton | Placeholder shape, content region busy state | Decorative to assistive tech; skeleton is not the only loading signal. Preserve layout, remove animation under reduced motion. | ## Input and selection | Component | Anatomy / variants | Required contract | | --- | --- | --- | | Text field / textarea | Persistent label, input, optional hint, error | Label remains visible after typing; connect hint/error programmatically. Validate on appropriate blur/submit, not hostile per-keystroke alarms. Preserve entered data on error. | | Password field | Label, input, reveal control | Allow paste/autofill; reveal control names state. Do not build custom password rules without product authority. Never include real secrets in demo fixtures. | | Search | Label, query, clear, result count | Debounce only remote work; cancel stale responses. Enter submits when expected. Clear button has name; no-result state shows query and a way to broaden it. | | Select | Label, trigger/native select, options | Native select for straightforward choices. Custom listbox only for a real need; expose selected state and type-ahead. Do not implement a menu as a select. | | Combobox | Label, editable field, suggestion popup | APG keyboard model and active option announcement. Loading/no matches distinct. Store stable option ID, not guessed text; allow free text only if specified. | | Checkbox | Label, checked/mixed state | Independent choices; group under legend. Mixed state only for a real aggregate. Label click/tap toggles. | | Radio group | Legend, options, selected value | One exclusive choice; arrow keys move selection on web. No surprise submit when selection changes. | | Switch | Label, on/off state | Immediate setting; persistent state name. If save is deferred, use a form control and explain save rather than pretending an instant switch. | | Segmented choice | Group label, small set of alternatives | Use radio semantics for a value; tabs only for content panels. Never choose semantics from visual shape. | | Slider / stepper | Label, current value, bounds, optional typed input | Arrow keyboard support, meaningful value text, exact input alternative. Do not require precision dragging. | | Date / time picker | Label, local format, explicit timezone where material | Native picker first. Store date-only separately from an instant; do not silently shift birthdays by timezone. Show ambiguous dates in words. | | File picker / drop zone | Select button, accepted type/size, per-file status | OS picker plus optional drop, not drop-only. Validate type/size server-side too. Allow cancellation; never upload just because a file was highlighted. | | Form | Heading, grouped fields, hints, error summary, action row | Submit shows summary linked to invalid fields; focus summary or first error consistently. Server validation remains authoritative. Unsaved changes and retry rules explicit. | ## Navigation and overlays | Component | Anatomy / variants | Required contract | | --- | --- | --- | | App shell | Global nav, title, content, optional inspector | One main landmark on web. Skip link, current location, meaningful heading. Compact uses one pane at a time, wide can use list/detail. Preserve selection across layout changes. | | Tabs | Tab list, selected tab, panel | Tabs change nearby panels, not URLs to unrelated pages. Keyboard arrows/Home/End; automatic activation only if immediate. Expensive panels use manual activation. | | Breadcrumbs | Ancestors, current page | Navigation with ordered hierarchy, current item identified; do not present every browser history step as an ancestor. | | Sidebar / navigation rail | Labelled destinations, current state, collapse control | Collapse preserves labels for accessibility. Mobile drawer gets an explicit close; navigation does not trap focus unless truly modal. | | Pagination | Range, previous/next, page choices | Preserve filters; announce updated results. Infinite scroll needs load-more or another reachable route and restored scroll position. | | Dialog | Name, purpose, content, close/cancel, action | Modal only for a bounded task. Constrain focus to modal, choose initial focus, Escape/cancel unless a documented safety reason, return focus after close. No nested modal stacks. | | Confirmation | Specific consequence, safe cancel, destructive action | Use only for material/irreversible effects. Prefer undo for reversible edits. Focus safe choice; explain what and whom the action affects. | | Sheet / drawer | Heading, body, close, optional drag handle | Drag handle is not the only close path. Keyboard and safe-area handling. Nonmodal inspector does not trap focus. | | Popover | Trigger, anchored content, dismiss | Keep within viewport; don't hide critical fields under soft keyboard. If interactive, manage focus according to chosen pattern. Hover alone cannot operate it. | | Tooltip | Concise supplemental text | Available on focus and hover; dismissible; no interactive controls; never the only label or error message. | | Accordion / disclosure | Heading button, expanded state, content | Real disclosure semantics, Enter/Space toggle. Preserve focus on trigger. Native details/summary is preferred for basic web content. | ## Data and specialised surfaces | Component | Anatomy / variants | Required contract | | --- | --- | --- | | Card | Heading, content, optional action/footer | Not every card is clickable. Avoid nested links inside a whole-card link. Content order remains logical when columns stack. | | List / list-detail | Stable item ID, primary/secondary text, optional status/action | Clear selection and focus are different states. Keyboard next/previous follows selected implementation. Empty, loading and error are distinct. | | Table | Caption, header scopes, rows, sort/filter controls | Real table for reading; grid only for genuine cell interaction. Announce sort; label row actions. Horizontal scroll is contained, not whole-page overflow. | | Data grid | Row/column navigation, edit/select/sort states | Use a mature grid and its keyboard model. Virtualised rows retain semantic counts, IDs and focus. Export and alternate view for complex data. | | Badge / avatar | Status text / name fallback | Decorative avatar has empty alternative; meaningful avatar names person once, not twice. Badge cannot carry status only by colour. | | Chart | Takeaway title, axes/units, direct labels, data alternative | Use identity chart contrast rules. Provide table/summary; keyboard access for meaningful interactive points. Don't make hover the only way to read values. | | Tree | Hierarchy, expand/collapse, selection | Only for true hierarchical navigation; APG/native tree keyboard behaviour. Distinguish expanded from selected. | | Splitter | Two regions, drag affordance, size constraints | Keyboard resize alternative, named separator, minimum pane sizes. Collapse secondary pane before making primary unusable. | | Command palette | Search, ranked labelled actions, shortcut hints | Supplemental, not the sole navigation. Keyboard and screen-reader tests required; product-defined shortcut must not replace OS/browser command. | | Notifications centre | Read/unread, timestamp, action, settings | No fake unread counts; keep history and dismissal state clear. Notification permission is a separate opt-in. | | AI-assisted panel | Prompt, draft, source/uncertainty, review, stop | Distinguish generated proposal from committed effect. Stream politely, offer stop, preserve edits, never turn model text into an automatic send or destructive command. | ## State coverage matrix For every interactive component test: default, hover (where relevant), pressed, focus-visible, selected/checked, disabled/read-only, pending, success, validation error, service error, empty and offline where applicable. Read-only is selectable/readable; disabled does not masquerade as read-only. A state that does not apply is marked N/A with a reason, not silently omitted. A component is ready only after checking its actual rendered appearance and accessibility tree on its target runtime. A web demo proves no native behaviour by itself.