Functional Weave
Code in Rust

Suites · forms

Verified forms: inputs, address, money, dates and file uploads

Accessible React form components whose rules are pure functions in every language: validated inputs, UK and international addresses, money, date pickers and file uploads, checked the same way in the browser and on the server.

43 capabilities (17 core, 26 optional) and 10 gaps, in build order. Put each line in the file that calls it, then fune build.

The components are React 19 and TypeScript only; each one's check (form.*) is in TypeScript, Python and Rust, so validate the submission on the server with the same rules rather than trusting the browser.

form.address checks the shape of an address and its postcode, not that it exists: a lookup against Royal Mail's PAF or another address service is network work and yours.

The components are React 19 and TypeScript only; the helpers (form.*) and the validation they pair with are in every language.

Core coverage: 63%

17 of 27 needs met by verified capabilities. The needs are this suite's 17 core members and its 10 named gaps; a core member counts when a version of it is verified (by the sandbox, or the registry's seed) and not yanked, and a gap never counts. Optional members are not needs.

Baseline: a hand-written app with no suite meets 0 of the same 27. In Rust: 29.6%. Method fune-coverage/1, computed 2026-11-22T20:50:23.862Z.

1. Validated inputs

Text, email and number inputs whose required, length, pattern and min/max rules are data, checked in the browser and again on the server.

form.validate-input core
Checks one value against InputRules with GOV.UK-style messages, in every language.
Check a text, email or number input: required, length, pattern and min/max, with GOV.UK messages.
fune!(form.validate-input@^1);  // then call validate_input(…)
react.form.validated-input core
The input with those rules as attributes, its message shown and described to screen readers.
A text, email or number input that checks itself with form.validate-input and shows the error accessibly.
Not available in Rust: typescript only
text.pattern-match optional
The pattern attribute's regular expression, matched the same way in Python and Rust.
Does the whole value match an HTML pattern attribute? The same answer in a browser, Python and Rust.
fune!(text.pattern-match@^1);  // then call matches_pattern(…)

2. Addresses

A UK address form, or an international one with each country's labels and postcode rules.

form.address core
Checks each field of an address and normalises it; UK postcodes by Royal Mail's rules.
Check a UK or international postal address form: required lines, lengths, country and postcode.
fune!(form.address@^1);  // then call validate_address, address_format
react.form.address-fields core
The address lines, town, region, postcode and country under one legend, autocompleted.
A UK or international address form under one legend: each line labelled and autocompleted, checked by form.address.
Not available in Rust: typescript only
validation.uk-postcode optional
The UK postcode check on its own, for a postcode-only field.
Validate a UK postcode and normalise it to canonical upper case with one space before the inward code.
fune!(validation.uk-postcode@^2);  // then call validate_uk_postcode(…)
  • address-lookup Finding the address from a postcode (Royal Mail PAF or a lookup API) is network work and yours.

3. Money

Amounts typed the way the person's locale writes them, held as integer minor units.

form.money-input core
Reads typed text as Money for a currency and locale, checks min and max, and writes it back.
Read a typed amount as minor units for its currency and locale, check min/max, and format it back.
fune!(form.money-input@^1);  // then call parse_money_input, format_money_input, money_input_format
react.form.money-field core
The amount input with its currency symbol and a decimal keyboard.
A money input with its currency symbol, locale separators and min/max, read and checked by form.money-input.
Not available in Rust: typescript only
money.format optional
Shows a stored amount with its symbol, outside the input.
Render a monetary amount as text, using the currency's real minor-unit precision.
fune!(money.format@^1);  // then call format_money(…)

4. Dates

Dates chosen in the browser's picker, or typed into day, month and year, as ISO dates with no time zone involved.

form.iso-date core
Checks a YYYY-MM-DD value against required, past/future and earliest/latest rules.
Check a date picker value (YYYY-MM-DD) against required, past/future and min/max rules, timezone-safe.
fune!(form.iso-date@^1);  // then call validate_iso_date(…)
react.form.date-field core
The browser's date picker with min and max, labelled and described.
A labelled date picker (<input type="date">) with min and max, checked by form.iso-date, its error shown accessibly.
Not available in Rust: typescript only
form.date-parts optional
The same rules for a date typed as day, month and year.
Check a date typed into day, month and year boxes, with GOV.UK's error messages and the boxes to mark in error.
fune!(form.date-parts@^1);  // then call validate_date_parts(…)
react.form.date-input optional
Day, month and year boxes, GOV.UK's choice for a date people already know.
Day, month and year boxes under one legend, with hint, error message and the boxes in error marked (GOV.UK date input).
Not available in Rust: typescript only

5. File uploads

Choose files in the browser, check them, and upload straight to object storage.

form.file-check core
Checks chosen files against accept, size and how-many rules, in the browser and before signing an upload URL.
Check files chosen in an upload field: accept types, size, empty files and how many, with GOV.UK messages.
fune!(form.file-check@^1);  // then call validate_files, accepts_file, format_file_size
react.form.file-upload core
The file input with accept and multiple, listing the chosen files with their errors.
A labelled file upload field: accept, size and how-many checked by form.file-check, the chosen files listed with errors.
Not available in Rust: typescript only
storage.signed-url optional
Signed PUT and GET URLs, so the bytes go straight to S3 or Google Cloud Storage (an integration).
Signed URLs for a browser to upload a file straight to S3 or Google Cloud Storage, and to download it.
Not available in Rust: typescript only
  • upload-progress Progress bars, resumable and chunked uploads, and retrying a failed upload are yours.
  • upload-scanning Virus scanning and checking what a file really contains (not just its name and type) are yours.

6. Errors

Tell people what to fix, and take them to it.

react.form.error-summary core
"There is a problem" box linking to each field in error, focused on arrival.
A "There is a problem" box linking to each field in error, focused on arrival, built from a validator's fields (GOV.UK).
Not available in Rust: typescript only
form.state optional
Values, touched fields and errors as a reducer, so messages show after a field is touched.
A form's state as a pure reducer: values, touched fields, validator errors and the submit, for useReducer.
Not available in Rust: typescript only

7. Fields from forms-ui

Labelled, hinted inputs with their errors wired up for screen readers (React, TypeScript only).

react.form.form-field core
Wires a label, hint and error message to one control by id.
Wire a label, hint and error message to one form control by id, the accessible way (GOV.UK form group pattern).
Not available in Rust: typescript only
react.form.text-field core
Single-line text input with hint, error, autocomplete, prefix and suffix.
A labelled single-line text input with hint, error message, autocomplete, prefix and suffix (GOV.UK text input).
Not available in Rust: typescript only
react.form.button core
Primary, secondary or warning button that stays focusable while loading.
A form button in primary, secondary or warning style that stays focusable while loading (GOV.UK button).
Not available in Rust: typescript only
react.form.textarea optional
Multi-line box with an optional live character or word count.
A labelled multi-line text box with hint, error and an optional live character or word count (GOV.UK).
Not available in Rust: typescript only
form.character-count optional
The "You have 20 characters remaining" message, in any language.
The GOV.UK character count message for a text box: characters or words left or over a limit, with a threshold.
fune!(form.character-count@^1);  // then call character_count(…)
react.form.select optional
Drop-down list with hint, error and an optional empty first option.
A labelled drop-down list with a hint, error message and an optional empty first option (GOV.UK select).
Not available in Rust: typescript only
react.form.password-field optional
Password input with Show/Hide and a live policy checklist.
A password input with a Show/Hide button and an optional live checklist of a password policy (GOV.UK password input).
Not available in Rust: typescript only

8. Choices from forms-ui

Questions answered by picking.

react.form.radio-group optional
Choose one of several radios, with hints, an "or" divider and inline yes/no.
Choose exactly one of several radios, with item hints, an "or" divider and inline yes/no (GOV.UK radios).
Not available in Rust: typescript only
react.form.checkbox-group optional
Tick any of several checkboxes, with an exclusive "None".
A question answered by ticking any of several checkboxes, with item hints and an exclusive "None" (GOV.UK checkboxes).
Not available in Rust: typescript only
react.form.checkbox optional
One checkbox such as "I agree to the terms".
One checkbox with its label beside it, such as "I agree to the terms" (GOV.UK single checkbox).
Not available in Rust: typescript only
react.form.fieldset optional
Groups related inputs under a legend with a shared hint and error.
Group related inputs under a legend, with a hint and error message described to the whole group (GOV.UK fieldset).
Not available in Rust: typescript only

9. Styles from forms-ui

A default look you can theme.

react.form.styles optional
Optional stylesheet for the caps-* classes, themed by --caps-form-* properties.
An optional stylesheet for the react.form elements' caps-* classes, themed by --caps-form-* custom properties.
Not available in Rust: typescript only

10. Contact details from validation-basics

Check and normalise a person's contact details before storing them.

validation.email core
Is an email address plausible, by a documented subset of RFC 5322.
Is this a plausible email address? A documented, pragmatic subset of RFC 5322, not the full grammar.
fune!(validation.email@^1);  // then call is_email(…)
validation.phone-e164 core
Normalises a phone number to +44… E.164 for a default country.
Normalise a phone number to E.164 (+447700900123) using a default country's trunk and dialling prefixes.
fune!(validation.phone-e164@^2);  // then call validate_phone_e164(…)
text.normalise-name optional
Tidies a typed name: spacing and title case with Mc, O' and hyphen rules.
Tidy a personal name: trim, collapse whitespace and title-case, with Mc, Mac, O', hyphen and van/de rules.
fune!(text.normalise-name@^1);  // then call normalise_name(…)
auth.normalise-email optional
Lower-cases an email's domain for storage and lookup.
Trim an email address and lower-case its domain for storage and lookup, or null if it is not a plausible address.
fune!(auth.normalise-email@^1);  // then call normalise_email(…)

11. Bank details from validation-basics

Check payee and customer bank details before money moves.

validation.iban core
Checks an IBAN's mod-97 checksum and its country's length.
Check an IBAN against the ISO 13616 mod-97-10 checksum and the registered length for its country.
fune!(validation.iban@^1);  // then call is_iban(…)
validation.bic optional
Checks a SWIFT/BIC code's format and splits it.
Check the format of a SWIFT/BIC code (8 or 11 characters) and split it into its parts.
fune!(validation.bic@^1);  // then call validate_bic(…)
validation.uk-sort-code-account optional
Checks a UK sort code and account number by the Vocalink modulus rules, against a table you supply.
Check a UK sort code and account number with the Vocalink/Pay.UK modulus rules, against a table you supply.
fune!(validation.uk-sort-code-account@^3);  // then call validate_uk_sort_code_account(…)
validation.uk-modulus-table optional
Parses Vocalink's VALACDOS and SCSUBTAB files into that table.
Parse Vocalink's VALACDOS.txt and SCSUBTAB.txt into the table UK sort code modulus checking needs.
fune!(validation.uk-modulus-table@^1);  // then call parse_uk_modulus_table(…)

12. Identifiers and check digits from validation-basics

Catch mistyped reference numbers by their check digits.

validation.luhn optional
Luhn mod-10 check, for card numbers and many reference numbers.
Check a digit string against the Luhn mod-10 checksum used by payment cards and many identifiers.
fune!(validation.luhn@^1);  // then call is_luhn(…)
validation.uk-company-number optional
Checks a Companies House number's format and prefix.
Check a Companies House company number's format and prefix (SC, NI, OC, LP...) and zero-pad it to eight characters.
fune!(validation.uk-company-number@^2);  // then call validate_uk_company_number(…)
validation.lei optional
Checks a Legal Entity Identifier's check digits.
Check a 20-character Legal Entity Identifier against its ISO 17442 / ISO 7064 MOD 97-10 check digits.
fune!(validation.lei@^1);  // then call validate_lei(…)
validation.gtin optional
Checks an EAN/UPC/GTIN barcode number.
Check an EAN-8, UPC-A, EAN-13 or GTIN-14 barcode number against the GS1 mod-10 check digit.
fune!(validation.gtin@^1);  // then call validate_gtin(…)

13. Displaying sensitive values from validation-basics

Show stored identifiers without exposing them.

text.mask optional
Masks all but the last digits of a card, account or phone number.
Mask all but the last n characters of a card, account or phone number, optionally keeping separators.
fune!(text.mask@^1);  // then call mask(…)

Gaps

What this kind of app usually needs that Functional Weave does not have yet: write these yourself, or use a service.

  • submission Posting the form, CSRF protection and putting the server's errors back into the fields.
  • rich-pickers Custom calendar widgets, date ranges, and searchable country or currency pickers.
  • other-frameworks Vue, Svelte, Angular or React Native components: only React is covered.
  • multi-step-flows Multi-page journeys: routing between steps, check-your-answers pages and saving progress.
  • autocomplete Autocomplete or combobox inputs (address finder, country picker).
  • email-deliverability Whether a mailbox exists (MX lookups, a confirmation email): validation.email checks the syntax only.
  • vocalink-data The Vocalink modulus tables themselves: download them from Pay.UK under its terms; caps parses them but does not ship them.