PH App Kit

On this page

The PH App Kit is the design system for apps that open inside Performance Hub: dashboards, reports, lists, forms, admin screens and interactive tools. Link one stylesheet and one script, and the app gets the Performance Hub font, colours and components. It also follows the user's light or dark choice, and Performance Hub's keyboard shortcuts keep working inside it.

A dashboard built with the PH App KitA dashboard built with the PH App Kit

Figure 1: A dashboard built only from kit components

Quick reference

What it is: a hosted stylesheet (ph-app.css), a small script (ph-app.js), optional scripts for charts, calendars, rich text, maps, data grids and drag-and-drop, and a React package (ph-app-kit-react) with the same look.

Where it's hosted: Performance Hub serves it at https://app.performancehub.co/assets/app-kit/v1/, so every app shares one cached copy and picks up fixes automatically.

Who it's for: anyone building an app that people will open from Performance Hub. When the Performance Hub Agent builds an app for you, it uses the kit automatically. See Building apps with your Agent.

Live examples: every component on one page, in plain HTML: https://app.performancehub.co/assets/app-kit/examples/plain.html, and the optional modules at https://app.performancehub.co/assets/app-kit/examples/extras.html.

When to use it

Use the kit forDon't use the kit for
Dashboards and reportsWebsites for a business
Lists and records people browse, search and editLanding pages and event pages
Forms, settings and wizardsPortfolios, menus and invitations
Planners, timetables and boardsAnything where the look itself is the point
Admin screens and internal tools

The rule of thumb: if people will mostly use it, build it with the kit. If people will mostly look at it, design it freely. An app with a public marketing page can do both: the app's screens use the kit and the marketing page doesn't.

What you get

  • The Performance Hub look: the Source Sans Pro font, colour tokens, spacing and every common component, styled the same way as Performance Hub's own screens.
  • Light and dark mode with no extra work: every component, chart and module has both. Inside Performance Hub the app follows the user's choice live; in a plain browser tab it follows the operating system.
  • Full-width layouts: pages fill the window, so dashboards and tables use wide screens.
  • Charts, KPI tiles and heatmaps in the Performance Hub palette.
  • Optional modules for an event calendar, a rich text editor, maps, a data grid for thousands of rows, and drag-and-drop lists and boards.
  • Helpers on window.phApp: fetching JSON with timeouts and readable errors, formatting numbers and dates, CSV export, live updates, toasts and confirmation dialogs.
  • Performance Hub integration: the app keeps Performance Hub's shortcuts working, dims the whole window behind its dialogs, and tells Performance Hub when it has loaded.

Components

A dashboard built only from kit componentsA dashboard built only from kit components

Layout and structure

Actions and input

Navigation

Data display

Feedback

Charts

Optional modules

Building apps

Layout and structure

ComponentWhat it's for
LayoutPages, page headers, grids, rows, stacks and split views
Page patternsReady-made structures for list, dashboard, detail, settings and wizard pages
CardsThe container for almost every piece of content
ThemingLight and dark mode, colour tokens and typography

Actions and input

ComponentWhat it's for
ButtonsPrimary, secondary, ghost and danger buttons, icon buttons and button groups
FormsText fields, selects, text areas, checkboxes, radios, switches and sliders
Segmented controlPicking one of a few options, such as a period
Toolbar and searchSearch, filter chips and actions above a table
MenusDropdown menus of actions
TooltipsShort hints on hover and keyboard focus
ComponentWhat it's for
TabsSwitching between sections of one page
StepsShowing progress through a wizard
BreadcrumbsShowing where a page sits and linking back up

Data display

ComponentWhat it's for
TablesSortable, paged tables of records
Badges and statusBadges, status dots, avatars and keyboard keys
Description listsLabel and value pairs for one record
TimelineA record's activity, newest first
ListsSimple divided lists
Progress and metricsUsage against a limit, and progress bars
IconsLine icons sized and coloured for the kit

Feedback

ComponentWhat it's for
Dialogs and drawersModal dialogs, confirmations and side panels
ToastsShort, non-blocking confirmations and errors
CalloutsNotices and errors inside the page
Empty statesWhat to show when there's nothing yet, or loading failed
LoadingSkeletons, spinners and busy buttons

Charts

ComponentWhat it's for
ChartsLine, area, bar, donut, gauge, scatter and sparkline charts
KPI tilesA headline number with its change and trend
HeatmapDaily activity over months

Optional modules

ModuleWhat it's for
CalendarTimetables, bookings and rosters
Rich text editorFormatted text people write, and showing it safely
MapsLocations on a map, with no API key
Data gridThousands of rows with search, sorting and inline editing
Drag and dropReorderable lists and kanban boards

Building apps

PageWhat it covers
Getting startedAdding the kit to a page, your first page, and React setup
Building apps with your AgentHow your Agent uses the kit and checks its work
JavaScript APIEverything on window.phApp
ReactThe ph-app-kit-react package and its components
Performance Hub integrationTheme, shortcuts, dialogs and loading inside Performance Hub
GuidelinesCopy, accessibility, keyboard, speed and production readiness
ReferenceEvery class, script, size and token in one place
Common questionsAnswers to frequent questions

Getting started checklist

  1. Add the kit's stylesheet and script to the page's <head> (Getting started).
  2. Wrap the page in .ph-page with a .ph-page-header (Layout).
  3. Pick the page pattern that matches the view.
  4. Build with kit components, and give every view a loading, empty and error state.
  5. Check the page in light and dark mode (add ?phTheme=dark to the URL).
  6. Follow the guidelines for copy, keyboard use and speed.