Mapping table
Review field mapping in small categories and source examples.
Interactive example
Loading Polaris web components…
Usage
<MappingTable groups={fieldGroups} fields={fields} columns={headers} mapping={mapping} examples={sourceRow} onChange={setMapping} />Properties
| Property | Type | Default | Description |
|---|---|---|---|
| groups | {title,icon,fields}[] | Required | Roughly 5–7 related fields per category. |
| fields | Record<string,string> | Required | Destination IDs and labels. |
| columns | string[] | Required | Real uploaded headers. |
| mapping | Record<string,string> | Required | Controlled assignments. |
| examples | Record<string,unknown> | — | First actual source row. |
| onChange | (mapping)=>void | Required | Updates source only. |
| targetLabel | string | Target schema field | Destination field column heading. |
Design & interaction
Review categories through disclosure. Show destination, source column and a real example. Mapping never writes native business records. Use native chevron and arrow icons in fixed, centered columns. Preserve the source-to-field alignment when categories expand.
Accessibility
Native disclosure and labeled selects. Logical keyboard order; examples hide on narrow screens.
Open-source source
Available in github.com/Kaupvik/kaupvik-polaris ↗. Host apps supply authentication, native persistence, and read-back state.