.github | ||
Documentation/Reference | ||
Icons | ||
Sources/Adwaita | ||
Tests | ||
user-manual | ||
.gitignore | ||
.swiftlint.yml | ||
CONTRIBUTING.md | ||
Contributors.md | ||
LICENSE.md | ||
Makefile | ||
Package.swift | ||
README.md | ||
SUMMARY.md |
Adwaita
User Manual · GitHub · Contributor Docs
Adwaita is a framework for creating user interfaces for GNOME with an API similar to SwiftUI.
The following code:
struct Example: View {
@State private var count = 0
var view: Body {
Text("\(count)")
.style("title-1")
.padding(50)
.topToolbar {
HeaderBar.start {
Button(icon: .default(icon: .goPrevious)) {
count -= 1
}
Button(icon: .default(icon: .goNext)) {
count += 1
}
}
}
}
}
Creates a simple counter view:
More examples are available in the demo app:
Table of Contents
Goals
Adwaita’s main goal is to provide an easy-to-use interface for creating GNOME apps. The backend should stay as simple as possible, while not limiting the possibilities there are with Libadwaita and GTK.
If you want to use Adwaita in a project, but there are widgets missing, open an issue on GitHub.
Widgets
An overview of the widgets supported by Adwaita is available here.
Installation
Dependencies
If you are using a Linux distribution, install libadwaita-devel
or libadwaita
(or something similar, based on the package manager) as well as gtk4-devel
, gtk4
or similar.
On macOS, follow these steps:
- Install Homebrew.
- Install Libadwaita (and thereby GTK 4):
brew install libadwaita
Swift Package
- Open your Swift package in GNOME Builder, Xcode, or any other IDE.
- Open the
Package.swift
file. - Into the
Package
initializer, underdependencies
, paste:
.package(url: "https://github.com/AparokshaUI/Adwaita", from: "0.1.0")
Usage
I recommend using the template repository as a starting point.
Basics
Advanced
Information
Thanks
Dependencies
- Libadwaita licensed under the GPL-3.0 license
- Levenshtein Transformations licensed under the MIT license
Other Thanks
- The contributors
- SwiftLint for checking whether code style conventions are violated
- The programming language Swift
- SourceDocs used for generating the docs