Skip to main content
.NETStandard2.1

Templates for Fabulous.XamarinForms

Published
Jan 4, 2023
3y ago
Total Downloads
181.5K
181,524

Install

dotnet add package Fabulous.XamarinForms.Templates --version 2.1.2
ProductVersions
.NET Standard
netstandard2.1

README

Templates for Fabulous.XamarinForms

Fabulous.XamarinForms brings the great development experience of Fabulous to Xamarin.Forms, allowing you to harvest the vast ecosystem of Xamarin.Forms with a tailored declarative UI DSL and clean architecture.

Deploy to any platform supported by Xamarin.Forms, such as Android, iOS, macOS, Windows, Linux and more!

/// A simple Counter app

type Model =
    { Count: int }

type Msg =
    | Increment
    | Decrement

let init () =
    { Count = 0 }

let update msg model =
    match msg with
    | Increment -> { model with Count = model.Count + 1 }
    | Decrement -> { model with Count = model.Count - 1 }

let view model =
    Application(
        ContentPage(
            "Counter app",
            VStack(spacing = 16.) {
                Image(Aspect.AspectFit, "fabulous.png")

                Label($"Count is {model.Count}")

                Button("Increment", Increment)
                Button("Decrement", Decrement)
            }
        )
    )

How to use the templates

Using the dotnet CLI, install the templates:

dotnet new -i Fabulous.XamarinForms.Templates

Then, you will be able to create new Fabulous.XamarinForms projects with dotnet new:

dotnet new fabulous-xf -n MyApp

If you're using Visual Studio on Windows, prefer the fabulous-xf-vswin template instead.

dotnet new fabulous-xf-vswin -n MyApp

Changes from Previous Version

No structural changes between v2.1.1 and v2.1.2.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.