4.3 KiB
Generic UI, Accessibility, and Metadata Guide
This is a template foundation, not a complete design system. Generated projects must replace branding, public copy, legal placeholders, and metadata before production.
Branding and theme
- Change the application name, default title, title template, and description in
react/src/config/site.js. - Change the baseline HTML metadata and theme color in
react/index.html. - Maintain shared Sass colors and surface/focus tokens in
react/src/styles/colors.scss; component-specific layout remains in CSS modules beside the component. - Supply product and developer assets with useful alternative text or an accessible link label. Do not use a logo as the only readable product name without an accessible equivalent.
- The inherited developer identity is configured under
site.developerinreact/src/config/site.js; change its name, URL, asset path, and accessible link label together if a generated project uses a different developer identity.
The generator replaces the generic application name in the HTML title, logo, and site configuration. Product descriptions, colors, icons, and images remain an explicit generated-project task.
Page structure and responsive behaviour
- Keep one descriptive
h1in each primary page view and use headings in order. - Use semantic
main,article,section,nav,header, andfooterelements where their meaning applies. - Preserve the global skip link and
#main-contenttarget inreact/src/App.jsx. - Build mobile-first. Check at approximately 320 px, 768 px, and a representative desktop width without treating those widths as a fixed support matrix.
- Avoid fixed heights around content that can wrap, translate, or expand. The header deliberately uses
min-heightso collapsed navigation can grow.
Forms and interaction
- Every input needs a programmatically associated visible label unless an equally clear accessible-name pattern is justified.
- Provide client and server validation, disabled/loading submission controls, an error with
role="alert", and success/progress text withrole="status"where appropriate. - Errors must not reveal whether an account exists when that would enable enumeration.
- All actions must be keyboard reachable. Preserve the global
:focus-visibleindicator. - Respect
prefers-reduced-motion; do not add essential information that depends only on animation, color, hover, or pointer input. - Recheck foreground/background contrast after changing shared theme values.
Metadata, indexing, and public URLs
react/src/components/PageMeta/PageMeta.jsx controls the runtime title, description, and robots directive. Public informational pages may be indexed; login, registration, account-action, protected, error, and other private or utility pages must use noIndex.
react/public/robots.txt is deliberately domain-neutral. Before production:
- Confirm which routes are genuinely public and useful to search engines.
- Decide whether the SPA deployment needs prerendering or server rendering for the target crawler requirements. Runtime metadata alone does not guarantee crawler discovery.
- Generate a sitemap containing only canonical public URLs after the production origin is known.
- Add the absolute sitemap URL to
robots.txt. - Add canonical and social-sharing metadata using confirmed production URLs and project-owned assets.
Do not place secrets, analytics identifiers, private routes, reset or verification tokens, or user-specific URLs in metadata or sitemaps.
Legal placeholders
react/src/views/Legal/Privacy.jsx and react/src/views/Legal/Terms.jsx are warnings/placeholders only. They are not legal advice and are not production policies. Replace them following project-specific review of jurisdiction, users, data processing, providers, retention, cookies, and applicable law.
Validation checklist
- Run
npm test,npm run lint, andnpm run buildfromreact/. - Test keyboard-only navigation, skip-link visibility, focus order, form errors, loading states, and navigation expansion.
- Inspect representative mobile, tablet, and desktop viewports.
- Inspect page titles, descriptions, robots directives, and the production
robots.txtresponse. - Use a suitable accessibility scanner when available, then manually review semantics and interaction; automated checks are not sufficient by themselves.