# KptDataView (kpt-data-view) Presents a list of items in a list or grid layout, with optional pagination (reusing `kpt-paginator`). The item template comes through projection: ``. Import: `import { KptDataView } from '@konce-pt/angular';` ## Inputs / model - `items`: T[] - `layout`: model<'list' | 'grid'> (the toggle in the bar) - `pageSize`: model (0 = no pagination) - two-way, because the paginator's select writes to it - `pageSizeOptions`: number[] (empty = the select offers the current size only) - `gridColumns`: model (0 = as many as fit) - two-way, the density bar writes to it - `gridColumnsOptions`: number[] (fewer than two = no density bar) - `gridMinWidth`: string (default `10rem`) - the narrowest card worth rendering - `paginated`: boolean - `layoutMotion`: `'spring' | 'arc' | 'morph' | 'none'` (default from `provideKptMotion`, else `spring`) - see below ## Example
{{ p.name }}
## The column count is a ceiling `gridColumns` caps the grid, it does not pin it: the track minimum grows to the width of one of N columns, so a narrow container drops to two or one column instead of squeezing cards below `gridMinWidth`. Set `gridColumns` to one of `gridColumnsOptions` - with a value outside the list no density button reads as active. ## The pager stays while there is a choice It shows up when the items outgrow one page, and also when `pageSizeOptions` holds more than one size. Otherwise picking the largest size would hide the very select that was just used, with no way back to a smaller one. ## Layout motion `layoutMotion` animates a layout or density change made from the built-in bar: - `spring` - each card glides from its old place to the new one on a spring and resizes; the content is counter-scaled, so it never stretches. A light cascade from the first item. - `arc` - cards lift (shadow, slight zoom), fly along an arc tilted toward the move and land softly; the wave starts at the clicked button. - `morph` - the browser's own morph (View Transitions): frames morph, old and new content cross-fade, clipped rather than stretched. Without browser support the change is instant. A view transition covers the whole document and blocks clicks for ~0.6 s. - `none` - no motion. With no value it takes `layout` from `provideKptMotion` (default `spring`); `enabled: false` there and the system "reduce motion" setting always win. A click in the middle of a flight starts the next one from where the cards are on screen. A layout set from outside (`[layout]`, `[gridColumns]`) switches instantly - the old state has to be measured before the DOM changes.
{{ p.name }}
## Tokens Item cards `--kpt-color-surface-raised`; the toggle `--kpt-color-primary`.