Data display / Table

Data display

Table

The base table: a header, hairline-separated rows, figure columns, sorting, selection, a sticky header and frozen columns.

import { EcoTable } from "vue-ecosphere"

Table

Keep the identifying column first with a subtitle; put figures in a numeric column. Never stripe.

RequestOwnerStatusAge
Deploy requestRelease 4.12Daniel OkaforPending3d
Access reviewContractor groupGrace KimApproved1d
Domain transfernorthwind.exampleAdam WoodsBlocked9d
Seat increase40 → 55 seatsElena PetrovaDraft2d
Data exportQ3 activityKiara CasmerIn review5d

Compact

For dense review work, offered as the reader’s choice.

RequestOwnerStatusAge
Deploy requestRelease 4.12Daniel OkaforPending3d
Access reviewContractor groupGrace KimApproved1d
Domain transfernorthwind.exampleAdam WoodsBlocked9d
Seat increase40 → 55 seatsElena PetrovaDraft2d

Sortable

Click a header: ascending, descending, then off. Only the sorted column shows its arrow.

Status
Domain transfernorthwind.exampleAdam WoodsBlocked9d
Data exportQ3 activityKiara CasmerIn review5d
Deploy requestRelease 4.12Daniel OkaforPending3d
Seat increase40 → 55 seatsElena PetrovaDraft2d
Access reviewContractor groupGrace KimApproved1d

Sorted by Age (descending)

Selectable

Check rows, or the header to select the page. With some rows checked the header box is indeterminate.

RequestOwnerStatusAge
Deploy requestRelease 4.12Daniel OkaforPending3d
Access reviewContractor groupGrace KimApproved1d
Domain transfernorthwind.exampleAdam WoodsBlocked9d
Seat increase40 → 55 seatsElena PetrovaDraft2d
Data exportQ3 activityKiara CasmerIn review5d

2 selected: r1, r3

Sticky header

Whenever the body scrolls, keep the header: a header that scrolls away turns every figure into a guess.

RequestOwnerStatusAge
Deploy requestRelease 4.12Daniel OkaforPending3d
Access reviewContractor groupGrace KimApproved1d
Domain transfernorthwind.exampleAdam WoodsBlocked9d
Seat increase40 → 55 seatsElena PetrovaDraft2d
Data exportQ3 activityKiara CasmerIn review5d
Key rotationPrimary clusterFelipe AlfaroPending6d
Deploy requestRelease 4.12Daniel OkaforPending3d
Access reviewContractor groupGrace KimApproved1d
Domain transfernorthwind.exampleAdam WoodsBlocked9d
Seat increase40 → 55 seatsElena PetrovaDraft2d
Data exportQ3 activityKiara CasmerIn review5d

Frozen first and last columns

A wide table scrolls sideways with the row’s name frozen at the left and its actions at the right. Never pin a middle column.

RequestOwnerTeamStatusAgeSeatsLast updateRegionActions
Deploy requestRelease 4.12Daniel OkaforSREPending3d12Two checks runningap-south-1
Access reviewContractor groupGrace KimSecurityApproved1d4Approved by Securityus-east-1
Domain transfernorthwind.exampleAdam WoodsPlatformBlocked9d27Waiting on registrareu-west-2
Seat increase40 → 55 seatsElena PetrovaFinanceDraft2d8Sent to Financeap-south-1
Data exportQ3 activityKiara CasmerAnalyticsIn review5d19In reviewus-west-2
Key rotationPrimary clusterFelipe AlfaroSREPending6d31Scheduled for Fridayeu-central-1

Empty

With no rows, the #empty slot fills a full-width row. Say what will fill it.

RequestOwnerStatusAge

No requests yet. New requests appear here as soon as someone files one.

API

NameTypeDefaultDescription
columnsEcoTableColumn[]—{ key, label, numeric?, width?, sortable?, action?, srLabel?, sortValue?, format? }. numeric renders col-num, right-aligned and tabular.
rowsobject[]—Row objects; identity from rowKey.
rowKeystring | (row) => key"id"Row identity for selection and keys.
#cell-<key> / #head-<key>{ row, value, index } / { column }—Override a cell or a header.
compactbooleanfalseDense rows, for scanning for one row among many.
stickybooleanfalseHeader stays put while the body scrolls.
nowrap / fixedbooleanfalseOne line per row (table--nowrap); fixed layout (table--fixedw).
pinFirst / pinLastbooleanfalseFreeze the identifying first column and the action column. Only when the table scrolls.
rowHeaderbooleanfalseFirst column as th scope="row".
selectablebooleanfalseCheckbox column with a select-all header (indeterminate for a partial page).
v-model:selected(string | number)[][]Selected row keys. Selected rows take the violet tint and accent rule.
v-model:sort{ key, dir: "asc" | "desc" } | nullnullHeader click cycles ascending → descending → off; aria-sort marks the sorted column.
manualSortbooleanfalseLeave rows in the given order (server-side sorting); still emits update:sort.
loadingbooleanfalseSkeleton rows and aria-busy.
captionstring—Visually hidden caption.
#empty——Shown in a full-width row when there are no rows. Say how rows will arrive.