A framework for creating user interfaces for GNOME with an API similar to SwiftUI https://adwaita-swift.aparoksha.dev/
Go to file
2024-01-06 17:24:21 +01:00
.github Migrate from SwiftGui to Libadwaita 2023-11-26 15:22:57 +01:00
Documentation/Reference Export Libadwaita types used in public functions 2024-01-04 13:56:30 +01:00
Icons Add option to toggle sidebar visibility 2023-12-20 06:12:07 +01:00
Sources/Adwaita Update button's handler on every view update 2024-01-06 17:24:21 +01:00
Tests Support long swiping in carousels 2024-01-04 11:26:42 +01:00
user-manual Add modifier for centering a view horizontally 2024-01-04 16:44:01 +01:00
.gitignore Initial Commit 2023-09-12 08:17:52 +02:00
.swiftlint.yml Migrate from SwiftGui to Libadwaita 2023-11-26 15:22:57 +01:00
CONTRIBUTING.md Migrate from SwiftGui to Libadwaita 2023-11-26 15:22:57 +01:00
Contributors.md Initial Commit 2023-09-12 08:17:52 +02:00
LICENSE.md Initial Commit 2023-09-12 08:17:52 +02:00
Makefile Initial Commit 2023-09-12 08:17:52 +02:00
Package.swift Add support for grouping controls with forms 2024-01-04 11:03:25 +01:00
README.md Make lists dynamic 2024-01-01 16:08:17 +01:00
SUMMARY.md Move the list of widgets to the user manual 2023-11-30 21:21:34 +01:00

Adwaita Icon

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:

Counter Example

More examples are available in the demo app:

Demo App

Table of Contents

Goals

Adwaitas 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:

  1. Install Homebrew.
  2. Install Libadwaita (and thereby GTK 4):
brew install libadwaita

Swift Package

  1. Open your Swift package in GNOME Builder, Xcode, or any other IDE.
  2. Open the Package.swift file.
  3. Into the Package initializer, under dependencies, 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

Other Thanks