Skip to content

Props & events ​

Props ​

PropTypeDefaultDescription
fieldsSchemaField[]—Required. The target schema your file columns map to.
locale'en' | 'es' | 'fr' | 'pt' | 'nl''en'UI language.
messagesMessagesOverride—Override individual strings for the active locale.
iconsIcons—Replace any default icon with your own component.
matcherMatcherFn—Custom auto-match function. Replaces the built-in key/label/alias matcher.
output'rows' | 'mapping''rows'What @mapped emits. 'rows' sends the mapped column data; 'mapping' sends { file, mapping, hasHeaders } so your backend does the reading. transform is ignored when 'mapping'.
transformTransformFn—Convert each data row before @mapped fires. Return null to exclude a row. Ignored when output is 'mapping'.
previewRowsnumber5How many data rows to show in each column card.
defaultHasHeadersbooleantrueWhether the first row is treated as a header on load and after reset.
autoIgnorebooleanfalseAutomatically set unmatched columns to "ignore" after auto-matching.
autoConfirmbooleanfalseEmit @mapped immediately if all columns are valid after auto-matching, without showing the confirm button.
maxFileSizenumber—Maximum file size in bytes. Files larger than this are rejected before parsing.
maxRowsnumber—Maximum number of data rows allowed. Files with more rows are rejected after parsing.
validateRowsRowValidator—Checks the mapped rows and reports problems. Runs after the mapping checks pass; blocks @mapped when it returns anything.
maxIssuesShownnumber50How many problems to list at once.
encodingstring—TextDecoder label (e.g. 'shift-jis') forcing the encoding of CSV/text files. Detected automatically when omitted; ignored for .xlsx and .xls.

Events ​

EventPayloadDescription
@mappedMappedResult[] | MappingOutput | unknown[]Emitted after successful validation. MappedResult[] by default, the output of your transform function if provided, or a MappingOutput when output="mapping".
@errorSheetMapperErrorEmitted when a file or validation error occurs.
@file-pickedFileEmitted immediately when the user selects a file, before parsing.
@columns-loaded{ name: string; assignedKey: string | null }[]Emitted after the file is parsed and columns are shown. Includes the detected column names and their initial auto-match result.
@invalidRowIssue[]Emitted instead of @mapped when validateRows reports problems.
@reset—Emitted when the user clicks "change file" and returns to the dropzone.

Released under the MIT License.