data-display/DSTable
DSTable
data-displayGeneric data table with column headers, alternating row tint, hover effect, and row selection support.
iOS 17+macOS 14+watchOS 10+tvOS 17+visionOS 1+
Purpose
Structured data in admin panels, dashboards, and macOS apps.
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| columnsreq | [DSTableColumn<T>] | — | Columns. Each has a title, optional width and alignment, and a cell builder. |
| rowsreq | [T] | — | Row data. T must be Identifiable. |
| onRowSelect | ((T) -> Void)? | nil | Row tap handler. |
Examples
User table
Name, email and role columns.
swift
DSTable(
columns: [
DSTableColumn("Name") { user in Text(user.name) },
DSTableColumn("Email") { user in Text(user.email) },
DSTableColumn("Role", width: 100, alignment: .trailing) { user in
DSBadge(user.role, variant: .soft)
},
],
rows: viewModel.users,
onRowSelect: { user in navigate(.userDetail(user)) }
)