Avalonia.FuncUI
2.0.0
Prefix Reserved
dotnet add package Avalonia.FuncUI --version 2.0.0
NuGet\Install-Package Avalonia.FuncUI -Version 2.0.0
<PackageReference Include="Avalonia.FuncUI" Version="2.0.0" />
<PackageVersion Include="Avalonia.FuncUI" Version="2.0.0" />
<PackageReference Include="Avalonia.FuncUI" />
paket add Avalonia.FuncUI --version 2.0.0
#r "nuget: Avalonia.FuncUI, 2.0.0"
#:package Avalonia.FuncUI@2.0.0
#addin nuget:?package=Avalonia.FuncUI&version=2.0.0
#tool nuget:?package=Avalonia.FuncUI&version=2.0.0
<h1 align="center"><img src="github/img/logo/FuncUI_Boxed.png" width="32px" alt="Avalonia FuncUI"> Avalonia FuncUI </h1>
<p align="center">Develop cross-platform GUI Applications using <a href="https://fsharp.org">F#<a> and <a href="https://github.com/AvaloniaUI/Avalonia">AvaloniaUI</a>!</p> <p align="center"> <img src="https://img.shields.io/github/languages/top/fsprojects/Avalonia.FuncUI" alt="GitHub top language"> <img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/fsprojects/Avalonia.FuncUI"> <img src="https://img.shields.io/github/license/fsprojects/Avalonia.FuncUI"> <a href="https://www.nuget.org/packages/Avalonia.FuncUI"> <img alt="Nuget (with prereleases)" src="https://img.shields.io/nuget/vpre/Avalonia.FuncUI?color=green&label=package%20Avalonia.FuncUI"> </a> </p><br>
About
FuncUI is a thin layer built on top of AvaloniaUI. 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
Breaking changes in version 2.0
Version 2.0 of FuncUI is built on Avalonia 12.0. Avalonia 12 has a number of breaking API changes which have necessitated matching breaking changes in FuncUI, such as the removal of previously obsoleted public functions and properties. Refer to the official Breaking changes in Avalonia 12 documentation for full details.
In addition, the DataGrid bindings which were previously built into the core FuncUI library have now been moved to the separate AvaloniaCommunity.FuncUI.Bindings.DataGrid package. This means that if you depend on the DataGrid bindings then you will need to reference the new package from your project, but projects which don't use DataGrid will no longer have an unused dependency on it.
Resources
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:
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.
Example using Elmish
The same counter as above but using the Avalonia.FuncUI.Elmish package:
module Counter =
type CounterState = { count : int }
let init = { count = 0 }
type Msg = Increment | Decrement
let 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
Maintainer(s)
The current co-maintainers of Avalonia.FuncUI are
- @Numpsy
- @JordanMarr
- @sleepyfran
- @JaggerJo (project originator)
The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management)
Commercial Support
Provided by Voynoic Systems GmbH
Please reach out to contact@voyonic-systmes.de if you need a commercial support contract or are interested in contract work.
Star History
<a href="https://star-history.com/#fsprojects/Avalonia.FuncUI&Date"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=fsprojects/Avalonia.FuncUI&type=Date&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=fsprojects/Avalonia.FuncUI&type=Date" /> <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=fsprojects/Avalonia.FuncUI&type=Date" /> </picture> </a>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Avalonia (>= 12.1.0)
- FSharp.Core (>= 6.0.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Avalonia.FuncUI:
| Package | Downloads |
|---|---|
|
Avalonia.FuncUI.Elmish
Elmish integration for Avalonia.FuncUI |
|
|
SilkyFowl.Avalonia.FuncUI.LiveView
Live fs/fsx previewer for Avalonia.FuncUI. |
|
|
Navs.FuncUI
Package Description |
|
|
FluentAvalonia.FuncUI.Bindings
FluentAvalonia.FuncUI.Bindings is a library that integrates FluentAvalonia with Avalonia.FuncUI. It contains bindings that enable the use of FluentAvalonia's controls in an F# context offered by Avalonia.FuncUI. |
|
|
AvaloniaCommunity.FuncUI.Bindings.DataGrid
Avalonia.FuncUI bindings for Avalonia.Controls.DataGrid |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Avalonia.FuncUI:
| Repository | Stars |
|---|---|
|
AvaloniaUI/Live.Avalonia
In-app live reload for Avalonia applications.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 6 | 7/28/2026 |
| 2.0.0-preview2 | 101 | 7/26/2026 |
| 2.0.0-preview1 | 641 | 4/27/2026 |
| 1.6.0 | 1,323 | 4/8/2026 |
| 1.5.2 | 3,436 | 11/13/2025 |
| 1.5.1 | 18,314 | 9/5/2024 |
| 1.5.0 | 598 | 8/12/2024 |
| 1.4.0 | 1,109 | 4/26/2024 |
| 1.3.0 | 1,546 | 2/23/2024 |
| 1.2.0 | 887 | 1/6/2024 |
| 1.1.0 | 1,127 | 10/23/2023 |
| 1.0.2 | 374 | 10/22/2023 |
| 1.0.1 | 2,314 | 8/8/2023 |
| 1.0.0 | 2,384 | 7/6/2023 |
| 1.0.0-rc1.1.1 | 308 | 6/26/2023 |
| 1.0.0-rc1.1.0 | 1,114 | 6/20/2023 |
| 0.6.0-preview9.1 | 545 | 4/2/2023 |
| 0.6.0-preview9 | 527 | 3/10/2023 |
| 0.6.0-preview8 | 417 | 2/26/2023 |