Avalonia.FuncUI 0.6.0-preview4

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
This is a prerelease version of Avalonia.FuncUI.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Avalonia.FuncUI --version 0.6.0-preview4
NuGet\Install-Package Avalonia.FuncUI -Version 0.6.0-preview4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Avalonia.FuncUI" Version="0.6.0-preview4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Avalonia.FuncUI --version 0.6.0-preview4
#r "nuget: Avalonia.FuncUI, 0.6.0-preview4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Avalonia.FuncUI as a Cake Addin
#addin nuget:?package=Avalonia.FuncUI&version=0.6.0-preview4&prerelease

// Install Avalonia.FuncUI as a Cake Tool
#tool nuget:?package=Avalonia.FuncUI&version=0.6.0-preview4&prerelease

Stand With Ukraine

<p align="center"><img src="github/img/logo/FuncUI.png" width="400px" alt="Avalonia FuncUI"></p> <h1 align="center">Avalonia FuncUI</h1> <p align="center">Develop cross-platform GUI Applications using F# and <a href="https://github.com/AvaloniaUI/Avalonia">AvaloniaUI</a>!</p> <p align="center"> <a href="https://voyonic-labs.visualstudio.com/Avalonia.FuncUI/_apis/build/status/AvaloniaCommunity.Avalonia.FuncUI?branchName=master"><img src="https://voyonic-labs.visualstudio.com/Avalonia.FuncUI/_apis/build/status/AvaloniaCommunity.Avalonia.FuncUI?branchName=master"></a> <img src="https://img.shields.io/github/languages/top/JaggerJo/Avalonia.FuncUI" alt="GitHub top language"> <img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/JaggerJo/Avalonia.FuncUI"> <img src="https://img.shields.io/github/license/JaggerJo/Avalonia.FuncUI"> <a href="https://gitter.im/Avalonia-FuncUI/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"><img src="https://badges.gitter.im/Avalonia-FuncUI/community.svg"></a> </p><br>

alternate text is missing from this package README image (Application was created using Avalonia.FuncUI!)

About

This library allows you to write cross-platform GUI Applications entirely in F# - No XAML, but either using React/Sutil inspired components or a declarative Elm-like DSL with MVU (Model-View-Update) architecture support and Elmish bindings built-in.

Getting started

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)
                    ]
                ]
            ]
        )

This and more examples using the component library 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)
                ]
            ]
        ]    

This and more examples using Elmish in the Elmish Examples folder

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)

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Avalonia.FuncUI:

Package Downloads
Avalonia.FuncUI.Elmish The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Package Description

SilkyFowl.Avalonia.FuncUI.LiveView

Live fs/fsx previewer for Avalonia.FuncUI.

Navs.FuncUI

Package Description

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
1.3.0 486 2/23/2024
1.2.0 461 1/6/2024
1.1.0 731 10/23/2023
1.0.2 141 10/22/2023
1.0.1 1,100 8/8/2023
1.0.0 1,063 7/6/2023
1.0.0-rc1.1.1 129 6/26/2023
1.0.0-rc1.1.0 446 6/20/2023
0.6.0-preview9.1 360 4/2/2023
0.6.0-preview9 304 3/10/2023
0.6.0-preview8 182 2/26/2023
0.6.0-preview7 506 1/26/2023
0.6.0-preview6.1 118 1/23/2023
0.6.0-preview6 161 1/22/2023
0.6.0-preview5 194 1/19/2023
0.6.0-preview4 197 1/15/2023