@get-asset/react
Vendors
Styled, drop-in Vendors directory — name, email, phone and an active/disabled status dot per row. The header carries a name search, an Active/Disabled filter, and an “Add vendor” button that reveals a panel above the table; each row's kebab offers Edit, which expands the same form from the row, and Disable. Name is the only required field. Covers loading, error, empty and success, and restacks onto a narrow layout via a container query.
Built on the headless Contacts compound from @get-asset/sdk.
Preview
Loading preview…
Required scopes
The access token used by AssetProvider must include these scopes for this primitive to fetch data successfully:
customer:readcustomer:createcustomer:updatevendor:readvendor:createvendor:update
API reference
Root props
| Prop | Type | Default | Description |
|---|---|---|---|
pageSize | number | 25 | Rows per request. Further pages load from the footer's Load more button. |
contacts | ContactOverride[] | — | Override the fetched vendors (skips the API call). The search and status filters still apply, client-side. |
state | "loading" | "error" | "empty" | — | Force a specific state for testing. |
hasMore | boolean | — | Force the Load more button when using contacts (previews/tests). |
defaultCreating | boolean | false | Open the add-vendor panel on mount. |
className | string | — | Forwarded to the outer Card wrapper element. |
States
Loading preview…
Loading preview…
Loading preview…
Loading preview…
Loading preview…
Loading preview…
Behaviour
Typing in the search box filters on the vendor's name and is debounced before the list is re-requested, so the table doesn't flash a loading state on every keystroke. The Active/Disabled dropdown switches between two listings rather than widening one, so every row in view carries the same status.
A disabled vendor drops out of the default listing and out of pickers, but the bills already recorded against it are untouched, and the same menu item re-enables it. Adding and editing share one form: only Name is required, and a cleared email or phone is saved as empty rather than left behind.
The empty state adapts to why it's empty — a search that matched nothing offers to clear it, the disabled listing says everyone is active, and a genuinely empty directory offers the add action.
Every value, control and gate is a slot on the headless compound. See the Contacts part inventory to rearrange the layout or swap the primitives, and AssetCustomers for the same surface over customers.