Prism Docs

List

Simple and flexible list component to display a series of rows.

Basic Usage

Basic list demonstrating header, footer, and bordered layout.

Header
Racing car sprays burning fuel into crowd.
Japanese princess to wed commoner.
Australian walks 100km after outback crash.
<prism-list header="Header" footer="Footer" [bordered]="true">
  <prism-list-item>Racing car sprays burning fuel into crowd.</prism-list-item>
  <prism-list-item>Japanese princess to wed commoner.</prism-list-item>
  <prism-list-item>Australian walks 100km after outback crash.</prism-list-item>
</prism-list>

Avatar & Meta Pattern

Common list item layout pattern with an avatar, title, and description.

avatar

Prism UI Concept

Ant Design, a design language for background applications, is refined by Ant UED Team
avatar

Prism Architecture

Ant Design, a design language for background applications, is refined by Ant UED Team
avatar

Prism Performance

Ant Design, a design language for background applications, is refined by Ant UED Team
<prism-list [dataSource]="data()" [itemTemplate]="itemTpl" [bordered]="true">
</prism-list>

<ng-template #itemTpl let-item>
  <prism-list-item [extra]="actionTemplate">
    <prism-list-item-meta 
      [title]="titleTemplate" 
      [description]="item.description" 
      [avatar]="avatarTemplate">
    </prism-list-item-meta>
  </prism-list-item>

  <ng-template #titleTemplate>
    <a href="https://ng.ant.design">{{ item.title }}</a>
  </ng-template>

  <ng-template #avatarTemplate>
    <img [src]="item.avatar" alt="avatar" style="width: 40px; height: 40px; border-radius: 50%;" />
  </ng-template>

  <ng-template #actionTemplate>
     <a style="color: var(--prism-primary-color); cursor: pointer;">edit</a>
  </ng-template>
</ng-template>

Grid Mode

Automatically layout list items in a grid. This mode automatically drops to 1 column on mobile screens.

Card content related to Prism UI Concept
Card content related to Prism Architecture
Card content related to Prism Performance
<prism-list [grid]="{ gutter: 16, column: 3 }" [dataSource]="data()" [itemTemplate]="gridItemTpl">
</prism-list>

<ng-template #gridItemTpl let-item>
  <prism-list-item>
    <prism-card [title]="item.title">
      {{ item.description }}
    </prism-card>
  </prism-list-item>
</ng-template>

API Overview

NameTypeDefaultDescription
dataSourceany[]undefinedArray of data objects to render
itemTemplateTemplateRef<any>-Template to render each item
borderedbooleanfalseToggles rendering of the border around the list
splitbooleantrueToggles rendering of the split under the list item
headerstring | TemplateRef<unknown>-List header content
footerstring | TemplateRef<unknown>-List footer content
loadMorestring | TemplateRef<unknown>-Load more content
grid{ gutter: number, column: number }nullGrid layout configs

prism-list-item-meta

NameTypeDefaultDescription
avatarstring | TemplateRef<any>-Avatar node of list item
titlestring | TemplateRef<any>-Title of list item
descriptionstring | TemplateRef<any>-Description of list item