Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patriksvensson/spectre-kit
A Swift framework that makes it easier to create beautiful console applications.
https://github.com/patriksvensson/spectre-kit
swift terminal
Last synced: 2 days ago
JSON representation
A Swift framework that makes it easier to create beautiful console applications.
- Host: GitHub
- URL: https://github.com/patriksvensson/spectre-kit
- Owner: patriksvensson
- License: mit
- Created: 2023-12-03T17:20:10.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-10-18T11:38:56.000Z (29 days ago)
- Last Synced: 2024-10-31T03:05:16.234Z (16 days ago)
- Topics: swift, terminal
- Language: Swift
- Homepage:
- Size: 154 KB
- Stars: 144
- Watchers: 7
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `SpectreKit`
A Swift library that makes it easier to create beautiful terminal applications.
It is a port of [Spectre.Console](https://spectreconsole.net) which in turn is heavily inspired by
the excellent Python library, [Rich](https://github.com/Textualize/rich).> [!NOTE]
> SpectreKit is currently under development, and many things are still missing.## Example
![Screenshot of example](./Resources/Screenshot.png)
```swift
import SpectreKitlet console = Console()
console.write(
Panel(
Table()
.addColumns("Foo", "[green]Bar[/]", "Baz")
.addRow(Markup("[red]abc[/]"), Text("def"), Markup("[yellow]lol[/]"))
.addRow(
Markup("[green bold]Corgi[/]"), Text("jkl"),
Table()
.addColumn("Foo")
.addColumn("Bar")
.addColumn("Baz")
.addRow(Markup("[red]abc[/]"), Text("def"), Markup("[yellow]lol[/]"))
.addRow(Markup("[green bold]Corgi[/]"), Text("jkl"), Markup("[blue]wtf[/]"))
.setBorder(TableBorder.doubleEdge)
.setTitle("A table in a table in a panel")
.setCaption("A [blue]caption[/]")
)
.setTitle("A table in a panel")
.setBorder(TableBorder.rounded)
)
.setHeader("[white]A panel[/]")
.setBorderColor(Color.rgb(128, 128, 0)))
```