Skip to content

Data Table

Data table with sorting, row selection, and cell slots.

Usage

vue
<script setup>
import { ArchDataTable } from "@archora/ui";

const columns = [
  { key: "name", label: "Name", sortable: true },
  { key: "status", label: "Status" }
];
const rows = [{ id: 1, name: "Core", status: "Healthy" }];
</script>

<template>
  <ArchDataTable :columns="columns" :rows="rows" selectable @row-click="openRow" />
</template>

Live sandbox

Data Table can be tested directly on this page.

interactive
Select rowStatus
ConsoleHealthy92
BillingWatch76
DeployBlocked43
<ArchDataTable :columns="columns" :rows="rows" selectable />

Props

PropTypeDefaultDescription
columnsArchDataTableColumn[]-Column definitions.
rowsRecord<string, unknown>[]-Row data.
rowKeystring"id"Row key field.
selectedKeysArray<string | number>[]Selected row keys.
sortBystring-Sort field.
sortDirection"asc" | "desc"-Sort direction.
selectablebooleanfalseShows row selection.
loadingbooleanfalseShows the loading state.
emptyTextstring"No data"Empty-state text.
loadingTextstring"Loading"Loading text.

Events

EventPayloadDescription
update:selectedKeyskeys: Array<string | number>selectedKeys change.
update:sortBykey: stringsortBy change.
update:sortDirectiondirection: "asc" | "desc"sortDirection change.
rowClickrow: Record<string, unknown>Component event.

Slots

SlotPropsDescription
cell-Custom cell for a column key.