Toolforge Docs
DocsIO PrimitivestableInput

tableInput

Displays a table of data records and allows the user to select one or multiple rows.

Usage

table input

const customer = await io.tableInput({
  label: 'Select Customer',
  data: [
    { id: 1, name: 'John Doe', email: 'john@example.com' },
    { id: 2, name: 'Jane Smith', email: 'jane@example.com' },
  ],
  mode: 'single',
})

Props

PropDescriptionTypeRequiredDefault
labelThe label for the table inputstringYes
descriptionThe description for the table inputstringNoundefined
dataThe data records for the table inputreadonly DataRecord[]Yes
optionalWhether the table input is optionalbooleanNofalse
modeThe mode of the table input'single' | 'multiple'No'single'
minThe minimum number of rows that must be selected (multiple mode only)numberNoundefined
maxThe maximum number of rows that can be selected (multiple mode only)numberNoundefined
defaultValueThe default value for the table inputTableFieldOutputNoundefined

Returns

Returns the selected data record (single mode) or array of selected data records (multiple mode). Return type includes | undefined if optional: true. TypeScript infers the exact structure from the provided data.

Examples

Multiple row selection

table input multi select

const orders = await io.tableInput({
  label: 'Select Orders to Process',
  data: ordersList,
  mode: 'multiple',
  min: 1,
  max: 10,
  description: 'Select between 1 and 10 orders',
})

// Returns: Array of selected data records

On this page