david.aparoksha.dev/content/_index.md
2024-10-04 23:12:16 +02:00

91 lines
2.3 KiB
Markdown

+++
+++
<!---
{{ image(url="trailer.gif" full_bleed=true) }}
--->
# Native. Cross-platform. <div class="logo"> Aparoksha. </div>
<div style="margin-bottom: 2em;">
Create your next cross-platform app with Aparoksha to give it a native look on each platform.
Aparoksha is easy-to-use, safe, and <i>aparoksha</i>, meaning that its reactive and declarative approach as well as the clean syntax significantly enhance the readability.
</div>
<a class="inline-button" href="/tutorials/gettingstarted/">Get Started</a>
<br>
## Start with Simple Views
A view is a piece of the user interface.
Create your own views, such as `Avatar`, `Post`, and `Timeline`.
Combine them into pages, windows, and apps.
<!---
<aside>
{{ image(url="trailer.gif" transparent=true) }}
</aside>
--->
{% crt() %}
```
struct Timeline: View {
var posts: Posts
var view: Body {
ForEach(posts) { post in
Avatar(user: post.user)
Post(post: post)
}
}
}
```
{% end %}
## The Magic of the State
Each of your views has the ability to store state throughout view updates.
Let's create a simple counter view:
<!---
<aside>
{{ image(url="trailer.gif" transparent=true) }}
</aside>
--->
{% crt() %}
```
struct SearchView: View {
@State private var count = 0
var view: Body {
Button(icon: .minus) {
count -= 1
}
Text("\(count)")
Button(icon: .plus) {
count += 1
}
}
}
```
{% end %}
## Supported Platforms
Aparoksha's goal is to enable you to bring your app to as many users as possible on completely different platforms.
Therefore, it is built in an open and extensible way.
Creating a backend for a new platform is almost as simple as creating an app!
A list of some backends is available [here](@/backends/_index.md). They can be combined with Aparoksha in a simple way.
Aparoksha itself currently supports the three major desktop platforms [GNOME](@/backends/Adwaita/index.md), [Windows](@/backends/WinUI/index.md), and [macOS](@/backends/AppKit/index.md).
What makes the Aparoksha project unique is that each backend is a fully independent project, optimized for its platform.
In a cross-platform app, you can leverage the full potential of the individual backends by writing platform-specific bits of code.