Genesis

Packages

@marktiderman/genesis-forms-native

0.3.1Primitive · Forms

The React Native renderer for Genesis Forms: <FormFocus>, one question or content step per screen, with keyboard-aware scrolling, accessibility focus and announcements, Dynamic Type, reduced motion, a theme seam for system or Genesis colors, and seams for drafts, an offline outbox and photo uploads. The same definitions run on web, native and the server. Part of the Genesis framework.

The React Native renderer for Genesis Forms. `<FormFocus>` shows a form one question (or content step) per screen, on the same headless controller the web's `<Form>` uses (`useFormController` from `genesis-forms-react`), so it steps, validates, sends and announces exactly as the web does in focus layout. A **flow** (onboarding, a check-in, a guided exercise) is simply a form definition shown here.

It draws with plain React Native styles whose colors come from theme roles, so it works with or without NativeWind: iOS system colors by default (light and dark mode, increased contrast), Genesis tokens on Android, and your brand's `tint`.

pnpm add @marktiderman/genesis-forms-native

READMEChangelognpm

@marktiderman/genesis-forms-native

Components (4)

  • ButtonBeta

    A form's button: genesis-ui-native's `NativeButton` (its press feedback and accessibility), sized for a form (at least 48 points tall, growing with the text size) and colored from the form's theme, so a host's `tint` still applies.

  • ChoiceRow

    One option: the whole row is the target (at least 52 points tall), a real radio or checkbox.

  • FieldChrome
  • FormFocus

Hooks (3)

  • useFormNative

    The form's native context. Throws outside `<FormFocus>`.

  • useFormStyles

    The styles for the current theme, made once per theme.

  • useFormTheme

    The theme a form part draws with.

Other exports (42)

accessibilityFocus · accessibilityHint · ANSWER_PLACEHOLDER · AnswerInput · builtInContentRenderers · builtInRenderers · CalculatedField · ConsentField · ContentStep · createContentRegistry · DateField · DefaultBrand · defaultContentRegistry · DefaultEnding · DefaultErrorSummary · DefaultHeader · DefaultNavigation · DefaultNotice · DefaultProgress · defaultRegistry · DefaultStatus · failedMessage · formStyles · FormThemeProvider · Indicator · keyboardHints · MIN_TARGET · MultiChoiceField · NativeFieldRenderer · NumberField · OptionImage · PhotoField · photoProblem · questionLabel · randomKey · ScaleField · shapeDate · SingleChoiceField · submissionStatus · TextField · UPLOAD_WAIT_MESSAGE · YesNoField

And 31 types.