Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Working On Features
  2. Ui Components

UI Components

Using @prepared/ui-* packages and the design system.

Quick Reference
UI package hierarchy:
  1. @prepared911/ui - Foundational primitives (Button, Input, Dialog, Box)
  2. Specialized packages - Domain-specific features (data tables, charts, calendars)
  3. Custom components - Only when design system doesn't cover it
Before implementing:
  • Search the component library for existing components
  • Check Storybook for component APIs and examples
  • Review the design system for available icons and patterns
UI Packages
@prepared911/ui
Foundational primitives and general-purpose components:
Filters
The filter bar is Filters from @prepared911/ui/blocks/filters. useFilterState is not an export.
See the Filters design docs.
DataTable
Interactive tables:
Pattern: Column definitions in dedicated hook:
Charts
Drawer
A panel. The shell drawer host store is separate and is not this component.
Dates
The grid is Calendar. A field is DateInput, DateRangeInput, or DateTimeInput.
Audio
Playback is not a public component yet. The docs page for the current player stays until that component lands.
Component Discovery
Always check existing components before implementing new UI:
  1. Search component library - Check @prepared911/ui and specialized packages
  2. Review Storybook - See component examples and API documentation
  3. Check design tokens - Use CSS custom properties (--spacing-*, --color-*)
  4. Find icons - Check Icon enum in @prepared911/ui
Available in @prepared911/ui:
  • Layout: Box, FlexBox
  • Interactive: Button, Input, Checkbox, Radio, Select
  • Feedback: Dialog, Tooltip, Alert, Spinner
  • Display: Icon, Badge, Avatar, Card
Icon Usage
Composable Icons (Preferred)
Static SVG Assets
Use only when:
  • Icon specific to single component (not reused)
  • Requires custom styling not supported by composable icons
  • Part of larger illustration
Conditional Tooltips
Use disabled prop instead of conditional wrapper:
Tooltips on Disabled Elements
Tooltips work on disabled buttons without any wrapper—Radix Tooltip uses pointer events, which are not blocked by disabled:
When to Use Specialized Packages
Use DataTable when:
  • ✅ Displaying tabular data with sorting
  • ✅ Need filtering and pagination
  • ✅ Complex column configurations
  • ✅ Row selection and bulk actions
Use a chart when:
  • ✅ Displaying analytics and metrics
  • ✅ Line charts, bar charts, pie charts
  • ✅ Time-series data visualization
Use @prepared911/ui when:
  • ✅ Simple lists or cards (not complex tables)
  • ✅ Foundational UI (buttons, inputs, modals)
  • ✅ Layout primitives (Box, FlexBox)
Design Tokens with Box Props
Box props automatically use design tokens:
Styling Decision Flowchart
Example: Complete Feature
IncidentList is the query root: it owns the request, so it is the only component here that calls useQuery, and it selects the fields the table renders. If it rendered a component of our own per incident, that component would declare its own Component_prop fragment (see GraphQL Fragments).
To test IncidentList, render it with renderWithApollo and pin the data with MSW handlers. See Testing GraphQL Components.
Related Documentation
  • Styling - SCSS and BEM patterns
  • Tokens - Design tokens
  • Component Patterns - Component organization
Reference Files
For more detailed technical guidance, see these reference files:
  • react-ui-implementation SKILL.md
Previous
Working on features / Localization (i18n)
Next
Working on features / Storybook Stories
On this page
Quick Reference
UI Packages
@prepared911/ui
Filters
DataTable
Charts
Drawer
Dates
Audio
Component Discovery
Icon Usage
Composable Icons (Preferred)
Static SVG Assets
Conditional Tooltips
Tooltips on Disabled Elements
When to Use Specialized Packages
Use DataTable when:
Use a chart when:
Use @prepared911/ui when:
Design Tokens with Box Props
Styling Decision Flowchart
Example: Complete Feature
Related Documentation
Reference Files