FunGoo.Widgets
0.9.0
dotnet add package FunGoo.Widgets --version 0.9.0
NuGet\Install-Package FunGoo.Widgets -Version 0.9.0
<PackageReference Include="FunGoo.Widgets" Version="0.9.0" />
<PackageVersion Include="FunGoo.Widgets" Version="0.9.0" />
<PackageReference Include="FunGoo.Widgets" />
paket add FunGoo.Widgets --version 0.9.0
#r "nuget: FunGoo.Widgets, 0.9.0"
#:package FunGoo.Widgets@0.9.0
#addin nuget:?package=FunGoo.Widgets&version=0.9.0
#tool nuget:?package=FunGoo.Widgets&version=0.9.0
<p align="center"> <img src="fungoo.jpeg" alt="FunGoo" width="720"> </p>
FunGoo
F# helpers and bindings for Goo, a retained desktop UI framework rendered with Vulkan, and for Goo.Widgets, its composable widget library.
Goo is authored in G#. FunGoo is a thin layer of ease-ups for consuming it from F#, without hiding the framework:
- Children helpers — append blobs to
ContainerandButtonin one call, from a sequence or inline. - Fluent setters — chain configuration on the mutable Goo surface (
Window,TextEditorController,ShaderEffect). - Interop helpers —
voptionwrappers forTry*out-parameter methods, and inline conversions forLengthandColor. - Virtual lists — F# bindings for Goo's virtualized collections over an
IReadOnlyList, a sequence, or a count and indexer. - Widgets — generated bindings for Goo.Widgets in a separate
FunGoo.Widgetspackage: set plain widget properties through constructor assignment, and nullable properties through optional-value setters.
Getting started
Install the packages:
dotnet add package Goo
dotnet add package FunGoo
# optional: widget bindings
dotnet add package Goo.Widgets
dotnet add package FunGoo.Widgets
Describe your UI with plain F# values:
open Goo
open FunGoo.Children
let view =
Container(Width = Length.Percent 100, Padding = 24, Gap = 12)
.Children(
Text(Content = "Hello from F#", FontSize = 24),
Button(OnClick = fun _ -> printfn "clicked")
.Children(Text(Content = "Click me"))
)
Compose Goo.Widgets the same way. Constructor assignment covers plain properties and callbacks, and the generated optional-value setters take nullable properties: call them with a value to set it, or with no argument to reset it to the widget default.
open Goo
open Goo.Widgets.Actions
open FunGoo.Widgets
let reset =
ActionButton(
Label = "Reset",
Height = 42.0,
OnClick = fun () -> printfn "reset"
)
.backgroundColor(Color.Parse("#22c55e"))
.Build()
See samples/RaznorGoo for a complete media player: Goo widgets, adaptive state, LibVLCSharp audio, Material icons, and a custom file picker.
Building
Requires the .NET 10 SDK.
dotnet tool restore
dotnet build
dotnet run --project samples/RaznorGoo
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- FSharp.Core (>= 11.0.101)
- Goo (>= 0.31.0)
- Goo.Widgets (>= 0.22.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
### Added
- **MVU:** New `FunGoo.Mvu` package: run stock Elmish programs on Goo with `MvuCell`, which mounts a program as a cell and rebuilds it on each model change. Each cell owns its model, so a window can compose several MVU cells and a message in one cell rebuilds that cell only. The package adds subscription helpers for timers and Goo `Action` events, plus a `Cmd.ofAction` helper. See `samples/MvuSpike` for a counter and a timer as two independent cells.
### Changed
- **Core:** **Breaking:** The Goo dependency is now 0.31.0 (was 0.30.0). App startup moves to `Application.Configure` and `Application.Run`, window size uses `Size` with `LayoutSize`, `Window.TryPost` is now `Window.Post`, and `Cell.Mount` takes the key before the factory. The generated surface gains `Row` and `Column` children helpers and follows the new setter shapes.
- **Widgets:** **Breaking:** The Goo.Widgets dependency is now 0.22.2 (was 0.21.0). The generated surface follows the upstream rename of `Create*` element hooks to `Configure*` and drops the removed `Avatar.ImagePath` and `AsyncImage.ImagePath` setters.
- **MVU:** `FunGoo.Mvu` follows Goo 0.31.0. The post shape is `Window.Post`, and factory mounts take the key first.
- **Samples:** RaznorGoo and MvuSpike move to Goo 0.31.0 and the new startup, size, post, and mount call shapes.
- **Samples:** RaznorGoo now follows the `goo-fsharp` skill shape: shared playback state lives in one store record read inside `Build` (no adaptive values), widget callbacks arrive as function parameters instead of record fields, dependencies flow through capability interfaces with a single UI marshaller, playback subscriptions go through the `IPlayback` worker interface instead of a loose function returned beside it, and the file picker is its own mounted cell so background loads no longer rebuild the whole window.