LVGL.Net 0.1.2

dotnet add package LVGL.Net --version 0.1.2
                    
NuGet\Install-Package LVGL.Net -Version 0.1.2
                    
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="LVGL.Net" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LVGL.Net" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="LVGL.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LVGL.Net --version 0.1.2
                    
#r "nuget: LVGL.Net, 0.1.2"
                    
#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.
#:package LVGL.Net@0.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LVGL.Net&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=LVGL.Net&version=0.1.2
                    
Install as a Cake Tool

LVGL.Net

Di port oleh Kang Fadhil dari Gravicode Studios. Ported by Kang Fadhil of Gravicode Studios.

A multi-platform .NET 10 wrapper for LVGL v9, the embedded graphics library — plus a WPF visual designer with an AI design assistant, a cross-platform component demo, and a live sensor dashboard for the Raspberry Pi 4.

Documentation: English · Bahasa Indonesia

What is here

Project Purpose
src/LVGL.Net The core wrapper. Platform-agnostic, no NuGet dependencies, no UI framework
src/LVGL.Net.Sdl SDL2 backend — windowed output on Windows, macOS and Linux
src/LVGL.Net.Linux Framebuffer + evdev backend — direct to /dev/fb0, no window system
src/LVGL.Net.Ui Serializable layout model, runtime loader and C# code generator
src/LVGL.Net.Assistant Jack The Code Bender — Semantic Kernel assistant (OpenAI, Anthropic, Gemini, Ollama)
tools/LVGL.Designer WPF visual designer with a live LVGL preview and the AI assistant
samples/LVGL.Desktop Demo browser for the widget, layout and styling APIs
samples/LVGL.Raspi Raspberry Pi telemetry dashboard — CPU, temperature, memory, live chart
tests/LVGL.Net.Tests Unit tests; run without the native library
native/ LVGL build, ABI shim, lv_conf.h, build scripts

Install

dotnet add package LVGL.Net          # core wrapper, ships the native lvglnet for every RID
dotnet add package LVGL.Net.Sdl      # windowed output on Windows, macOS and Linux
dotnet add package LVGL.Net.Linux    # framebuffer + evdev, no window system
dotnet add package LVGL.Net.Ui       # layout document model, loader and C# generator

LVGL.Net.Sdl needs SDL2 itself on the machine — the package does not redistribute it. Install libsdl2-2.0-0 on Debian/Ubuntu, sdl2 via Homebrew, or drop SDL2.dll into runtimes/win-x64/native/ on Windows.

Build from source

./native/build.sh                            # Linux/macOS - builds LVGL + the shim
./native/build.ps1                           # Windows

dotnet build LVGL.Net.slnx
dotnet test  LVGL.Net.slnx

dotnet run --project samples/LVGL.Desktop    # needs SDL2
using var backend = new SdlBackend(480, 320, "Hello LVGL");
using var app = LvglApplication.Create(backend);

var button = new LvButton(app.Screen, "Tap me");
button.SetSize(160, 48);
button.Center();
button.Clicked += (_, _) => Console.WriteLine("clicked");

app.Run();

Design notes

The native library contains no display drivers. LVGL renders into a buffer and calls a flush callback; everything after that — SDL window, Linux framebuffer, off-screen preview — is managed code behind a four-member ILvglBackend. One native artifact serves every target, adding an output device is a C# class, and the library links nothing but libc and libm.

A small C shim covers what P/Invoke cannot do safely. lv_color_t is a three-byte struct whose by-value ABI differs between Windows x64 and SysV; lv_style_t's size is a compile-time detail; LVGL's fonts are exported variables; and lv_event_code_t ordinals shifted during the 9.x series. Each of those goes through an ABI-stable lvn_* entry point. Everything else calls lv_* directly, and the render path does not touch the shim at all.

Built for constrained hardware. Partial render mode by default, unmanaged draw buffers, unmanaged function pointers instead of marshalled delegates on the hot path, workstation GC, and no allocation per chart sample. The Raspberry Pi sample runs on ~100 KiB of draw buffers at 800×480.

One layout model, three consumers. The designer edits a UiDocument, UiBuilder instantiates it at run time, and CSharpUiGenerator emits equivalent C#. A previewed layout and a running one cannot drift apart.

The assistant validates before it answers. Jack The Code Bender designs layouts through a kernel function that checks them against the real document model, so a malformed layout comes back as fixable problems rather than as plausible JSON that will not open. Anthropic goes through the official SDK rather than an OpenAI-compatible shim — Claude removed the sampling parameters on its current models, and the connector drops a configured temperature for those rather than letting the request fail.

Requirements

  • .NET SDK 10.0
  • CMake 3.20+ and a C compiler, to build the native library
  • SDL2, only for the SDL backend

Status

The managed solution builds clean and its tests pass. The native library must be built once with CMake before anything renders; the wrapper reports a clear, actionable error until then, and the designer keeps working without it for everything except the preview.

License

LVGL is MIT-licensed. This wrapper follows suit.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on LVGL.Net:

Package Downloads
LVGL.Net.Sdl

SDL2 backend for LVGL.Net - windowed output and mouse/keyboard input on Windows, macOS and Linux.

LVGL.Net.Assistant

Jack The Code Bender - a Semantic Kernel design assistant for LVGL.Net, with OpenAI, Anthropic, Gemini and Ollama support.

LVGL.Net.Linux

Linux framebuffer and evdev backend for LVGL.Net - direct-to-display output with no window system, for Raspberry Pi and similar boards.

LVGL.Net.Ui

Serializable UI document model shared by the LVGL designer, the runtime loader and the C# code generator.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.2 111 9/1/2026
0.1.1 98 9/1/2026
0.1.0 102 9/1/2026