Skip to content

DataView API

API reference docs for the Stash DataView component. Learn about the props, CSS, and other APIs of this exported module.

Import

ts
import DataView from '@leaflink/stash/DataView.vue';

Props

NameTypeDefaultDescription
currentPagenumber1Can be used to provide the initial page. Also, it can be used to control the active page with `v-model:current-page="myPage"`.
currentSearchstringundefinedCan be used to set the initial search term. Also, it can be used to control the active search term with `v-model:current-search="mySearchTerm"`.
currentSortSortValueundefinedCan be used to provide the initial sort order. Also, it can be used to control the active sort order with `v-model:current-sort="mySortOrder"`.
dataArray() => []A list of records. If pagination is enabled, `data` must be only the current page of records.
densitySpacingDensitiescomfortableControls the DataView's padding; the default value is "comfortable". On small screens, "compact" density is applied regardless of this prop's value.
disablePaginationbooleanfalseOpt-out of displaying pagination. Hides the pagination buttons and page stats.
hideBottomPaginationbooleanfalseHides the bottom pagination without disabling the pagination from the toolbar
isLoadingboolean-
pageSizenumberDEFAULT_PAGE_SIZE
totalDataCountnumber0The total number of records available. Used to auto-enable pagination when results exist. DataView does not paginate data for you; instead, `props.data` should always show the current page of results.
variantDataViewVariantsundefinedDataView variant. The default value is `undefined`. Will default to `table` when used within a `<Module variant="table">`.

Slots

NameDescription
defaultdefault

Events

NameDescription
update
update:currentFilters
update:currentPage
update:currentSearch
update:currentSort