Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Collections

  • QuestionCard
  • Table
  • Book3D
  • ProTable
  • PricingTable
  • JsonViewer
  • EditableTable
  • List
  • Descriptions
  • RowActions
  • Tree
  • Card
  • Carousel
  • Video
  • Audio
  • BentoGrid
  • Image
  • MagicCard
  • AnimatedList
  • Marquee
  • Sortable
  • Kanban
  • DesignCanvas
  • LayerTree
  • StageDraw
  • SlideDeck
  • PresenterView
  • ComponentPicker
  • EventStream
  • QueueLane
  • DocumentSheet
  • Novel reader
  • Scheduler
  • Org classroom
  • Danmaku
  • LiveChat
  • LivePlayer
  • LogViewer
  • FileTree
  • CodeReviewThread
  • VirtualList
  • InfiniteScroll
  • LogoLoop
  • BounceCards
  • CardSwap
  • ChromaGrid
  • CircularGallery
  • DomeGallery
  • FlyingPosters
  • InfiniteMenu
  • MagicBento
  • ScrollStack
  • ProfileCard
  • TiltedCard
  • PixelCard
  • DecayCard
  • ReflectiveCard
  • Folder

Charts and Diagrams

  • Flow
  • Diagram
  • Paper
  • SequenceDiagram
  • Sankey
  • Sparkline
  • Funnel
  • Treemap
  • Gantt
  • Heatmap
  • ContributionGraph
  • Legend
  • Chart
  • WorldMap

Information

  • ImageViewer
  • LiveProductCard
  • DiffStat
  • ScoreRing
  • ScoreScale
  • Badge
  • Dot
  • StatusDot
  • Chip
  • FilterChip
  • Coupon
  • Tag
  • Annotation
  • Avatar
  • AvatarCircles
  • User
  • QRCode
  • Comment
  • RelativeTime
  • GitCommit
  • DeployStatus
  • ShieldBadge
  • AwardBadge
  • CreditCard
  • IconTile

Metrics

  • Stat
  • Statistic
  • Meter
  • Timeline
  • NumberTicker

Placeholders

  • Empty
  • Skeleton
  • Watermark

List

list

Presents accessible named lists with structured items, metadata, actions, grid mode, empty states, and pagination or load-more controls.

Usage

Basic usage

Data driver: items + renderItem, with ListItem.Meta for avatar/title/description, and actions for right operation.

Team Member
  • Chen
    Chen Jing
    Product Manager
    Details
  • Li
    Li Wei
    Front-end Engineer
    Details
  • Wang
    Wang Fang
    Designer
    Details
  • Zhao
    Zhao Qiang
    Backend Engineer
    Details
Total 4 People
tsx
<List
  bordered
  items={people}
  header={<span>Team Member</span>}
  footer={<span>Total {people.length} people</span>}
  renderItem={(p) => (
    <ListItem actions={[<Button key="e" variant="ghost" size="sm">Edit</Button>]}>
      <ListItem.Meta avatar={<Avatar fallback={p.initials} />} title={p.name} description={p.role} />
    </ListItem>
  )}
/>

No borders + no separation

Remove the outer frame and row separators, suitable for embedding inside existing cards/panels.

Team Member
  • Chen
    Chen Jing
    Product Manager
    Details
  • Li
    Li Wei
    Front-end Engineer
    Details
  • Wang
    Wang Fang
    Designer
    Details
  • Zhao
    Zhao Qiang
    Backend Engineer
    Details
Total 4 People
tsx
<List
  bordered={false}
  split={false}
  items={people}
  renderItem={(p) => (
    <ListItem>
      <ListItem.Meta avatar={<Avatar fallback={p.initials} />} title={p.name} description={p.role} />
    </ListItem>
  )}
/>

Grid card status

grid switches to a card grid (reusing the Grid primitive), and each card has its own border.

  • Chen
    Chen JingProduct Manager
  • Li
    Li WeiFront-end Engineer
  • Wang
    Wang FangDesigner
  • Zhao
    Zhao QiangBackend Engineer
tsx
<List
  grid={{ cols: 2, gap: 4 }}
  items={people}
  renderItem={(p) => (
    <ListItem actions={[<Button key="v" variant="outline" size="sm">View</Button>]}>
      <User name={p.name} description={p.role} avatarProps={{ fallback: p.initials }} />
    </ListItem>
  )}
/>

Empty

When items is an empty array, there is a built-in <Empty> placeholder.

Team Member
No data
tsx
<List bordered items={[]} header={<span>Team Member</span>} renderItem={(p) => ...} />

When to use

Use List for homogeneous member, message, setting, or resource entries. Use Table or EditableTable when headers, sorting, or editable columns matter. List is the lighter avatar-title-description-action pattern and can become a card grid.

Import

ts
import { List, ListItem, ListItemMeta } from "@hulianui/ui"

Props

ListProps<T>:

NameTypeDefaultDescription
itemsT[]-Data-driven entries used with renderItem.
size"sm" | "md" | "lg""md"Row padding density.
borderedbooleanfalseAdds an outer border and radius; ignored in grid mode.
insetbooleanFollows borderedHorizontal padding for rows, header, and footer.
splitbooleantrueRow separators; ignored in grid mode.
gridboolean | ListGridConfig-Card-grid mode; true uses three columns.
loadMoreListLoadMore-Bottom load-more action and loading state.

ListItemProps (the <ListItem> used in the compound form)

NameTypeDefaultDescription
actionsReactNode[]-Action area on the right of the row; separators are inserted between entries automatically.

ListItemMetaProps (<ListItemMeta>, the avatar / title / description trio on the left)

NameTypeDefaultDescription
avatarReactNode-Avatar or icon (reuses Avatar).
titleReactNode-Title.
descriptionReactNode-Description.

Slots

SlotTypeDescription
renderItem(item: T, index: number) => ReactNodeRenders each data item, usually as ListItem; omission treats the item as a React node.
childrenReactNodeComposed ListItem children, used only when items is absent.
headerReactNodeHeader content.
footerReactNodeContent at the very bottom.
emptyReactNodeEmpty state; omission uses built-in Empty.
paginationReactNodePagination content below the list.

ListGridConfig has cols (default 3), gap (default 4, multiplied by 0.25rem), colGap, rowGap, and rows. ListLoadMore has onLoadMore*, loading, hasMore (default true), and text; its built-in Chinese text is "\u52a0\u8f7d\u66f4\u591a", meaning “Load more.”

ListItemProps has actions?: ReactNode[] and children. ListItemMetaProps has avatar, title, and description.

Usage notes

  • items takes precedence over children. Use items + renderItem for data and children for static composition.
  • Grid mode ignores bordered and split; each card should own its border.
  • When loadMore.hasMore is false, the load-more action is not rendered.
  • The built-in empty title is "\u6682\u65e0\u6570\u636e", meaning “No data.”

Accessible name

aria-label, aria-labelledby, and aria-describedby are forwarded to the node with role="list"; other native attributes remain on the outer container. This makes getByRole("list", { name: "…" }) work and prevents assistive technology from encountering an unnamed list (hulianui/hulian#60).

Related

Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

Playground

Team Member
  • Chen
    Chen Jing
    Product Manager
    Details
  • Li
    Li Wei
    Front-end Engineer
    Details
  • Wang
    Wang Fang
    Designer
    Details
  • Zhao
    Zhao Qiang
    Backend Engineer
    Details
Total 4 People
<List
  size="md"
  bordered={true}
  split={true}
  items={people}
  renderItem={(p) => (
    <ListItem actions={[<Button variant="ghost" size="sm">Edit</Button>]}>
      <ListItem.Meta avatar={<Avatar fallback={p.initials} />} title={p.name} description={p.role} />
    </ListItem>
  )}
/>
PreviousEditableTableData DisplayNextDescriptions

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Slots
    • Usage notes
    • Related
  • Playground