Forms
The code on this page is React’s. How Vue writes it
| React | Vue | |
|---|---|---|
| Classes | className="p-4" | class="p-4" |
| Props | headerRows={1} | :header-rows="1" or :headerRows="1" |
A prop that is true | hyphenate | hyphenate |
| Content per page | render={({ pageNumber }) => …} | <template #render="{ pageNumber, totalPages }">…</template> |
| The page, deeper down | usePage() | usePage() (it injects the page) |
| What to render | <Invoice invoice={invoice} /> | h(Invoice, { invoice }) |
A template for generate | Template: ComponentType<{ data }> | Template: a component with the prop data |
The rest, and Vue’s own API, is in the Vue guide.
The code on this page is React’s. How Svelte writes it
| React | Svelte | |
|---|---|---|
| Classes | className="p-4" | class="p-4" (a list or an object of flags too) |
| Content per page | render={({ pageNumber }) => …} | {#snippet render(page)}{page.pageNumber}{/snippet} inside the Text or View |
| The page, deeper down | usePage() | usePage(), while the component is created |
| What to render | <Invoice invoice={invoice} /> | { component: Invoice, props: { invoice } } |
A template for generate | Template: ComponentType<{ data }> | Template: a component with the prop data |
The rest, and Svelte’s own API, is in the Svelte guide.
The code on this page is React’s. How Angular writes it
| React | Angular | |
|---|---|---|
| Components | <View>, <Path>, <TextField> | <ink-view>, <ink-path>, <ink-text-field>: ink- and the name in kebab case |
| Classes | className="p-4" | class="p-4", [class]="…" |
| Props | headerRows={1}, size="A4" | [headerRows]="1", size="A4" (an attribute is a string: bind numbers) |
A prop that is true | hyphenate | hyphenate |
| Style | style={{ padding: 20 }} | [style]="{ padding: 20 }"; [inkStyle] for @media blocks and lists of styles |
| Content per page | render={({ pageNumber }) => …} | [render]="footer" with <ng-template #footer let-page>{{ page.pageNumber }}</ng-template> |
| The page, deeper down | usePage() | injectPage() |
| What to render | <Invoice invoice={invoice} /> | { component: Invoice, inputs: { invoice } } |
A template for generate | Template: ComponentType<{ data }> | Template: a component with the input data |
The rest, and Angular’s own API, is in the Angular guide.
<TextField name="email" className="h-6 w-full rounded border border-gray-300 px-1" />
<Select name="plan" options={['Starter', 'Team']} value="Team" className="h-6 w-40 border" />
<List name="days" options={['Mon', 'Tue', 'Wed']} multiSelect value={['Mon', 'Wed']} className="w-40 border" />
<Checkbox name="terms" className="h-3.5 w-3.5 border" />
<Radio name="billing" value="yearly" checked className="h-3.5 w-3.5 rounded-full border" />
These are real AcroForm fields: readers fill them in any PDF viewer and save the file. name
must be unique, except for radio buttons of one group. Every field takes readOnly (viewers do
not let the user change it), required (it must be filled in before the form is
submitted) and label, what it is for, which screen readers say and
PDF/UA requires. TextField also takes multiline, maxLength and password; size, border,
background and text style come from the classes. TextInput is another name for TextField.

Switch to Layout for the boxes the engine laid out.
Drawn by the engine’s debug option, sizes in points.
A field's text, its value and the options of a Select or List, is drawn with the field's own
font only, a glyph per character, as viewers redraw it while the user types: no fallback fonts,
no shaping and no right-to-left ordering. A character the font lacks fails the render
(INVALID_VALUE at the value or the option), so give the field a font that covers its script.
Arabic, Hebrew and the scripts of India show their letters unjoined, in typed order.
Select is a drop-down list and List a list box, which shows several options at once (four
rows without a height) and starts at the first selected one. Both take their choices as
options, or select, and the selected one as value; a List with multiSelect takes an
array of them. Field is any of these, picked by its kind ("text", "checkbox",
"radio", "select", "list"), for forms built from data:
<Field kind={q.kind} name={q.name} … />.
sort puts the options of a Select or List in alphabetical order, ignoring case. A
Select with edit takes a typed value besides its options, and its value can be any text.
noSpell turns off the viewer's spelling check, on a TextField or on a Select with edit.
align ('left', 'center' or 'right') puts the value of a TextField, Select or List
in the middle or at the right of its box, in the appearance drawn and in viewers.
A FieldSet groups fields: it is a View, with the same props (render too), whose name
goes in front of the name of every field inside it, at any depth. Viewers show and export the
fields by those full names, and sets nest:
<FieldSet name="billing" className="gap-2">
<TextField name="street" /> {/* billing.street */}
<FieldSet name="contact">
<TextField name="email" /> {/* billing.contact.email */}
</FieldSet>
</FieldSet>
A dot in a field's own name does the same (name="billing.street"). A name is either a field
or a group: billing cannot also be a field when billing.street is one.
A single-line TextField takes a format, which it shows its value in and which viewers apply
as the user types:
<TextField name="fee" value="1250" format={{ type: 'number', currency: '$' }} /> {/* $1,250.00 */}
<TextField name="rate" value="0.125" format={{ type: 'percent', decimals: 1 }} /> {/* 12.5% */}
<TextField name="start" value="2026-10-14" format={{ type: 'date', pattern: 'd mmm yyyy' }} /> {/* 14 Oct 2026 */}
<TextField name="phone" value="5551234567" format={{ type: 'phone' }} /> {/* (555) 123-4567 */}
type | value | Options |
|---|---|---|
number | digits, as '-1234.5' | decimals (default 2, rounded half away from zero), separators ('1,234.56', '1234.56', '1.234,56', '1234,56'), negative ('minus', 'red', 'parens', 'parensRed'), currency and currencyBefore (default true) |
percent | a fraction, as '0.125' | decimals, separators |
date | '2026-10-14', with an optional time (T18:30) | pattern (required) |
time | '18:30' or '18:30:05', or a date with a time | pattern (required) |
zip, zipPlus4, phone, ssn | 5, 9, 10 or 9 digits | none |
A pattern is at most 64 characters of d, dd, ddd (Wed), dddd (Wednesday), m, mm,
mmm (Oct), mmmm (October), yy, yyyy, H, HH (0–23), h, hh (1–12), M, MM
(minutes), s, ss, t (a/p), tt (am/pm) and the characters .,/:-; names are English.
A time pattern takes only the time letters, H, h, M, s and t. Viewers apply the
format with the standard form scripts, which some (Preview) do not run; a PDF/A document leaves
the scripts out and keeps the formatted text.
The keys nDec, sepComma (true is '1,234.56', false '1234.56'), negStyle
('MinusBlack', 'Red', 'ParensBlack', 'ParensRed'), currencyPrepend and param are
other names for decimals, separators, negative, currencyBefore and pattern, and
zip4 for zipPlus4. A number or percent format with any of them defaults to no decimals and
no thousands separator, so { type: 'number', currencyPrepend: true } shows '1250' as
1250; without them, to 2 decimals and '1,234.56'. On a time, param is a style: 0 (HH:MM), 1 (h:MM tt), 2
(HH:MM:ss) or 3 (h:MM:ss tt).
Synced from packages/react/GUIDE.md in the inkoxide repository.
