DataView

DataView displays data in grid grid-cols-12 gap-4 or list layout with pagination and sorting features.

import { DataViewModule } from 'primeng/dataview';

DataView requires a value to display along with a list template that receives an object in the collection to return content.

Bamboo WatchINSTOCK
Accessories
Bamboo Watch
5
$65
Black WatchINSTOCK
Accessories
Black Watch
4
$72
Blue BandLOWSTOCK
Fitness
Blue Band
3
$79
Blue T-ShirtINSTOCK
Clothing
Blue T-Shirt
5
$29
BraceletINSTOCK
Accessories
Bracelet
4
$15

Pagination is enabled with the paginator and rows properties. Refer to the Paginator for more information about customizing the paginator.

Bamboo WatchINSTOCK
Accessories
Bamboo Watch
5
$65
Black WatchINSTOCK
Accessories
Black Watch
4
$72
Blue BandLOWSTOCK
Fitness
Blue Band
3
$79
Blue T-ShirtINSTOCK
Clothing
Blue T-Shirt
5
$29
BraceletINSTOCK
Accessories
Bracelet
4
$15

Built-in sorting is controlled by bindings sortField and sortOrder properties from a custom UI.

Bamboo WatchINSTOCK
Accessories
Bamboo Watch
5
$65
Black WatchINSTOCK
Accessories
Black Watch
4
$72
Blue BandLOWSTOCK
Fitness
Blue Band
3
$79
Blue T-ShirtINSTOCK
Clothing
Blue T-Shirt
5
$29
BraceletINSTOCK
Accessories
Bracelet
4
$15

DataView supports list and grid display modes defined with the layout property. The grid mode is not built-in for flexibility purposes and requires a library with CSS grid features like Tailwind.

Bamboo WatchINSTOCK
Accessories
Bamboo Watch
5
$65.00
Black WatchINSTOCK
Accessories
Black Watch
4
$72.00
Blue BandLOWSTOCK
Fitness
Blue Band
3
$79.00
Blue T-ShirtINSTOCK
Clothing
Blue T-Shirt
5
$29.00
BraceletINSTOCK
Accessories
Bracelet
4
$15.00
Brown PurseOUTOFSTOCK
Accessories
Brown Purse
4
$120.00
Chakra BraceletLOWSTOCK
Accessories
Chakra Bracelet
3
$32.00
Galaxy EarringsINSTOCK
Accessories
Galaxy Earrings
5
$34.00
Game ControllerLOWSTOCK
Electronics
Game Controller
4
$99.00
Gaming SetINSTOCK
Electronics
Gaming Set
3
$299.00
Gold Phone CaseOUTOFSTOCK
Accessories
Gold Phone Case
4
$24.00
Green EarbudsINSTOCK
Electronics
Green Earbuds
4
$89.00

While data is being loaded. Skeleton component may be used to indicate the busy state.

Screen Reader

The container element that wraps the layout options buttons has a group role whereas each button element uses button role and aria-pressed is updated depending on selection state. Values to describe the buttons are derived from the aria.listView and aria.gridView properties of the locale API respectively.

Refer to paginator accessibility documentation for the paginator of the component.

Keyboard Support

KeyFunction
tabMoves focus to the buttons.
spaceToggles the checked state of a button.
PrimeBlocks
490+ ready to use UI blocks crafted with PrimeNG and Tailwind CSS.