Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fsprojects/Avalonia.FuncUI
Develop cross-plattform GUI Applications using F# and Avalonia!
https://github.com/fsprojects/Avalonia.FuncUI
avalonia avaloniaui dotnet elmish fsharp gui mvu ui
Last synced: 4 months ago
JSON representation
Develop cross-plattform GUI Applications using F# and Avalonia!
- Host: GitHub
- URL: https://github.com/fsprojects/Avalonia.FuncUI
- Owner: fsprojects
- License: mit
- Created: 2019-05-09T19:51:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-10T13:09:04.000Z (4 months ago)
- Last Synced: 2024-03-10T14:22:08.756Z (4 months ago)
- Topics: avalonia, avaloniaui, dotnet, elmish, fsharp, gui, mvu, ui
- Language: F#
- Homepage: https://funcui.avaloniaui.net/
- Size: 18.6 MB
- Stars: 824
- Watchers: 33
- Forks: 70
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Lists
- awesome-fsharp - Avalonia.FuncUI - Develop cross-platform MVU GUI Applications using F# and Avalonia (GUI / Performance analysis)
- awesome-stars - fsprojects/Avalonia.FuncUI - Develop cross-plattform GUI Applications using F# and Avalonia! (F# #)
- awesome-elmish - Avalonia FuncUI - platform MVU GUI Applications using F# and Avalonia! (Desktop Gui)
README
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine)
Avalonia FuncUIDevelop cross-platform GUI Applications using F# and AvaloniaUI!
![](github/img/hero-multiple-apps.png)
## About
FuncUI is a thin layer built on top of [AvaloniaUI](https://github.com/AvaloniaUI/Avalonia). It contains abstractions
for writing UI applications in different programming styles. It also contains a component & state management system.FuncUI mostly consists of:
- Virtual DOM
- View DSL
- Component model## Resources
- 💨 [Getting started](https://funcui.avaloniaui.net)
- 📚 [Documentation](https://funcui.avaloniaui.net/)
- 📓 [Examples](https://github.com/fsprojects/Avalonia.FuncUI/tree/master/src/Examples)
## Contributing
Please contribute to this library through issue reports, pull requests, code reviews, documentation, and discussion.## Examples
### Example using components
A simple counter made with the component library:``` f#
type Components =
static member Counter () =
Component (fun ctx ->
let state = ctx.useState 0
DockPanel.create [
DockPanel.children [
Button.create [
Button.onClick (fun _ -> state.Set(state.Current - 1))
Button.content "click to decrement"
]
Button.create [
Button.onClick (fun _ -> state.Set(state.Current + 1))
Button.content "click to increment"
]
TextBlock.create [
TextBlock.dock Dock.Top
TextBlock.text (string state.Current)
]
]
]
)
```Find more examples using components in the [Components Examples folder](https://github.com/fsprojects/Avalonia.FuncUI/tree/master/src/Examples/Component%20Examples).
### Example using Elmish
The same counter as above but using the `Avalonia.FuncUI.Elmish` package:```f#
module Counter =
type CounterState = { count : int }
let init = { count = 0 }
type Msg = Increment | Decrementlet update (msg: Msg) (state: CounterState) : CounterState =
match msg with
| Increment -> { state with count = state.count + 1 }
| Decrement -> { state with count = state.count - 1 }
let view (state: CounterState) (dispatch): IView =
DockPanel.create [
DockPanel.children [
Button.create [
Button.onClick (fun _ -> dispatch Increment)
Button.content "click to increment"
]
Button.create [
Button.onClick (fun _ -> dispatch Decrement)
Button.content "click to decrement"
]
TextBlock.create [
TextBlock.dock Dock.Top
TextBlock.text (sprintf "the count is %i" state.count)
]
]
]
```Find more examples using Elmish in the [Elmish Examples folder](https://github.com/fsprojects/Avalonia.FuncUI/tree/master/src/Examples/Elmish%20Examples)
# Maintainer(s)
The current co-maintainers of Avalonia.FuncUI are
* @JordanMarr
* @sleepyfran
* @JaggerJo (project originator)The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management)