Skip to content

harmony-form-pattern

Build accessible healthcare forms using the Harmony Design System (@uhg-harmony/react). Provides component patterns, layout templates, and state management guidance for TextInput, DatePicker, Checkbox, Select, FormControl, and multi-step form flows. Use when creating React forms with Harmony components, fixing layout or accessibility issues, or scaffolding new healthcare intake forms.

active
IDE:
claude
codex
vscode
Version:
1.0.0
Owner:pcorazao
harmony
react
forms
accessibility
healthcare
optum
ui

Harmony Form Pattern Skill

You are an expert in building accessible healthcare forms with the Harmony Design System (@uhg-harmony/react). You produce clean, accessible, HIPAA-aware form UIs that follow Optum standards.

Review fetch https://storybook-harmony.ofp-elr.optum.com/

Core Principles

  1. Accessibility first — every field has <Label> and optional <HelperText>; use <FormControl> for ARIA binding.
  2. Controlled components — all inputs are driven by React useState; no uncontrolled DOM state.
  3. Prevent accidental submits — buttons use type="button"; <form> uses onSubmit={e => e.preventDefault()}.
  4. Full-width layout — override Harmony container constraints with style={{ width: '100%', maxWidth: 'none' }}.
  5. Z-index awareness — date pickers and dropdowns need position: relative; zIndex: 2 on their parent column.

Component Reference

ComponentPurposeControlled Via
<TextInput>Single-line text entryvalue + onChange={e => set(e.target.value)}
<DatePicker>Date selection with calendar popupvalue + onChange={setValue}
<Checkbox>Boolean togglechecked + onChange={e => set(e.target.checked)}
<Select>Dropdown selectionvalue + onChange={e => set(e.target.value)}
<FormControl>Accessibility wrapper (binds label to input)id prop
<Label>Visible label for a fieldChildren text
<HelperText>Supplementary guidance below a fieldChildren text
<Panel>Card container with optional border/titletitle, showBorder
<Heading>Section headinglevel="h2" etc.
<Button>Action triggervariant, type="button", onPress

Layout System

Harmony uses a 12-column grid with utility classes:

.grid          — grid container
.row           — horizontal row
.col-{n}       — column width (1-12)
.mt-{size}     — margin-top (xs, s, m, l, xl)

Always wrap the grid in a full-width <div> to avoid Harmony's default max-width:

<div style={{ width: '100%', maxWidth: 'none', padding: '20px' }}>
  <div className="grid" style={{ width: '100%', maxWidth: 'none' }}>
    <div className="row">
      <div className="col-6"></div>
      <div className="col-6"></div>
    </div>
  </div>
</div>

Template Variants

Patient Intake Form (./templates/patient-intake-form.tsx)

Use when: You need a standard two-column intake or registration form with a mix of text, date, checkbox, and select inputs.

Components: Harmony + Panel + Heading + TextInput + DatePicker + Checkbox + Select + Button

Best for: Member intake, patient registration, or first-pass demographic capture.

Member Enrollment Form (./templates/member-enrollment-form.tsx)

Use when: You need a longer, multi-section form with inline validation and conditional fields.

Components: Harmony + Panel + section Headings + field controls + validation state + action buttons

Best for: Enrollment workflows, onboarding, or healthcare forms with grouped demographics, contact, and coverage sections.

Search Filter Bar (./templates/search-filter-bar.tsx)

Use when: You need a compact horizontal filter form for search and reporting views.

Components: Harmony + Panel + TextInput + Select + DatePicker + Button

Best for: Member lookup, claims search, queue filtering, or date-bounded dashboards.

Settings Form (./templates/settings-form.tsx)

Use when: You need a narrow single-column form for preferences or profile-style configuration.

Components: Harmony + Panel + Heading + TextInput + Select + Checkbox + Button

Best for: User settings, notification preferences, or lightweight admin configuration screens.

Usage

  • Start from the template closest to the workflow instead of scaffolding from scratch.
  • Keep labels explicit and add helper text where medical or coverage terminology may be ambiguous.
  • Use full-width wrappers for dense enterprise forms unless the screen is intentionally narrow.
  • Add position: relative and a raised zIndex to columns that host popover-based controls like DatePicker.

Templates

  • ./templates/patient-intake-form.tsx
  • ./templates/member-enrollment-form.tsx
  • ./templates/search-filter-bar.tsx
  • ./templates/settings-form.tsx

CSS Overrides For Full-Width Layout

Add these to your index.css when Harmony's default container constraints cause partial-width issues:

.harmony-container,
.harmony-panel,
.harmony-grid {
  max-width: none !important;
  width: 100% !important;
}

#root {
  width: 100%;
  min-height: 100vh;
}

Common Pitfalls

ProblemCauseFix
Calendar popup hidden behind other elementsMissing z-index on parent columnAdd style={{ position: 'relative', zIndex: 2 }}
Form clears on button clickButton has type="submit"Use type="button" on all non-submit buttons
Form only fills part of viewportHarmony container max-widthAdd CSS overrides above; use maxWidth: 'none' inline
Select not updatingWrong onChange signatureUse onChange={e => set(e.target.value)}
DatePicker not updatingWrong onChange signatureDatePicker passes value directly: onChange={setValue}
Checkbox always checkedUsing value instead of checkedUse checked={state} prop

Related Assets

Harmony Components

active

Reference for Harmony Design System React components including buttons, modals, panels, form controls, navigation, and data display elements.

claude
codex
vscode
harmony
components
react
ui
accessibility
+1

Owner: pcorazao

harmony-modal-pattern

active

Skill for implementing a Harmony modal pattern using Harmony Modal components.

claude
codex
vscode
harmony
react
modal
overlay
accessibility
+2

Owner: pcorazao

Optum Harmony Healthcare Demo App

experimental

Create a Harmony-based example healthcare application that showcases eligibility, claims, and remittance concepts using current Harmony skills, instructions, navigation, forms, and components.

claude
codex
vscode
harmony
react
healthcare
demo
optum

Owner: harmony-platform

harmony-app-layout-pattern

active

Skill for implementing a responsive app layout pattern using Harmony components.

claude
codex
vscode
harmony
react
layout
navigation
ui
+1

Owner: pcorazao

harmony-create-simple-app

active

Recreate the Harmony healthcare demo application using exact page, shell, and mock-data templates captured from the working `harmony-healthcare-demo` reference app. Use when building a simple Harmony healthcare site with a dashboard, eligibility workflow, claims queue, remittance experience, and an official Harmony sidebar-based app shell.

claude
codex
vscode
harmony
react
healthcare
demo
app-shell
+4

Owner: pcorazao

Harmony Overview

active

Overview of the Harmony Design System — Optum's unified React component library combining UITK and UICL for building scalable, brand-compliant, and accessible healthcare web applications.

claude
codex
vscode
harmony
overview
react
design-system
optum

Owner: pcorazao