Form Components

List

The <List> component adds a scrollable option box to a PDF form. It is the same field type as Select and takes the same props — the difference is that a list shows several options at once instead of collapsing into a dropdown.

New to forms? Start with the Forms guide.

Props

PropTypeDefaultDescription
namestring''Field identifier. This is the key the value is exported under.
selectstring[][]The options the reader can choose from.
valuestring | numberThe currently selected option.
defaultValuestring | numberThe option the field reverts to when the form is reset.
editbooleanfalseAllows the reader to type a value that is not in the list.
sortbooleanfalseDisplays the options in alphabetical order.
multiSelectbooleanfalseAllows more than one option to be selected.
noSpellbooleanfalseDisables spell check on typed values. Only meaningful with edit.
requiredbooleanfalseMarks the field as mandatory before the form can be submitted.
readOnlybooleanfalseDisplays the selection but prevents the reader from changing it.
noExportbooleanfalseExcludes the field from the exported form data.
styleStyle | Style[]Size, position, and border of the field box.

Usage

vue
<template>
  <Document>
    <Page size="A4" :style="{ padding: 40 }">
      <Text :style="{ fontSize: 10, marginBottom: 4 }">Preferred language</Text>
      <List
        name="language"
        :select="['English', 'French', 'Yoruba', 'Hausa', 'Igbo']"
        value="English"
        default-value="English"
        :style="{
          height: 60,
          borderWidth: 1,
          borderColor: '#cbd5e1',
        }"
      />
    </Page>
  </Document>
</template>
Give a list enough height to show several rows — roughly the number of visible options times your font size. Too little height and the reader shows a single cramped row with a scrollbar.

Multiple Selection

vue
<template>
  <Document>
    <Page size="A4" :style="{ padding: 40 }">
      <List
        name="skills"
        multi-select
        sort
        :select="['Vue', 'TypeScript', 'Node', 'Rust']"
        :style="{ height: 70 }"
      />
    </Page>
  </Document>
</template>
Unlike <TextInput> and <Checkbox>, a <List> is not namespaced by an enclosing FieldSet — it always registers at the top level of the form. Give every list a globally unique name.