data-display/DSTable

DSTable

data-display
since v1.0

Generic data table with column headers, alternating row tint, hover effect, and row selection support.

iOS 17+macOS 14+

Purpose

Structured data in admin panels, dashboards, and macOS apps.

Props

PropTypeDefaultDescription
columnsreq[DSTableColumn<T>]Column definitions with title and key path.
rowsreq[T]Array of data items.
onSelect((T) -> Void)?nilRow tap handler.

Examples

User table

User list with name, email, and role.

swift
DSTable(
    columns: [
        DSTableColumn(title: "Name", keyPath: \.name),
        DSTableColumn(title: "Email", keyPath: \.email),
        DSTableColumn(title: "Role", keyPath: \.role),
    ],
    rows: viewModel.users,
    onSelect: { user in navigate(.userDetail(user)) }
)

Related Components