freysie / capsule-ui

Capsule UI for AppKit and SwiftUI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Capsule UI (🚧 Work in Progress 🚧)

Capsule UI for AppKit and SwiftUI.

Installation

.package(url: "https://github.com/freyaalminde/capsule-ui.git", branch: "main"),
.product(name: "CapsuleUI", package: "capsule-ui"),

Overview

CapsuleList {
  Capsule("Form Capsule") {
    Form {
      //
    }
  }
  Capsule("Table Capsule") {
    CapsuleTable(data) {
      //
    }
  }
}

Table Usage

CapsuleTable(data, selection: $selection) {
  CapsuleTableColumn("Name", value: \.name)
  CapsuleTableColumn("Email Address", value: \.emailAddress)
}

Images

CapsuleTable(data, selection: $selection) {
  CapsuleTableColumn("Name", value: \.name)
    .withImage { row in
      NSImage(systemSymbolName: "person", accessibilityDescription: nil)
    }

  CapsuleTableColumn("Email Address", value: \.emailAddress)
}

About

Capsule UI for AppKit and SwiftUI.

License:MIT License


Languages

Language:Swift 60.9%Language:Python 38.8%Language:Shell 0.3%