Skip to content

DataView ​

List / grid with pagination

A collection shown as cards or rows you design yourself — a catalogue, a gallery of episodes — with a list/grid switch and paging. For tabular data people sort and select, use DataTable.

Basic
8 episodes · list

第1話

2019.04.04

第2話

2019.04.05

第3話

2019.04.06

第4話

2019.04.07

  • The default slot renders each item with { item, index, layout }, so one template can adapt to list and grid.
  • columns is the minimum card width in grid layout; pageSize pages client-side (0 shows everything). When items shrinks, the page follows back to the last one.
  • #empty replaces "No items".

Usage ​

ts
import { BlessDataView } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
items*T[]—
rowKey((item: T, index: number) => string | number)—
pageSizenumber0
columnsstring"220px"min card width in grid layout
labelstring"Items"
switchablebooleantruehide the list/grid switch
layout"grid" | "list""list"

Events

NamePayloadDescription
update:layout[value: "grid" | "list"]

Slots

NameScopeDescription
header{ layout: "grid" | "list"; }
default{ item: T; index: number; layout: "grid" | "list"; }
empty—

Released under the MIT License. Character names and artwork belong to their owners.