FlexRender.DependencyInjection
0.4.1
See the version list below for details.
dotnet add package FlexRender.DependencyInjection --version 0.4.1
NuGet\Install-Package FlexRender.DependencyInjection -Version 0.4.1
<PackageReference Include="FlexRender.DependencyInjection" Version="0.4.1" />
<PackageVersion Include="FlexRender.DependencyInjection" Version="0.4.1" />
<PackageReference Include="FlexRender.DependencyInjection" />
paket add FlexRender.DependencyInjection --version 0.4.1
#r "nuget: FlexRender.DependencyInjection, 0.4.1"
#:package FlexRender.DependencyInjection@0.4.1
#addin nuget:?package=FlexRender.DependencyInjection&version=0.4.1
#tool nuget:?package=FlexRender.DependencyInjection&version=0.4.1
FlexRender
A .NET library for rendering images from YAML templates with a full CSS flexbox layout engine. Perfect for generating receipts, labels, tickets, and structured documents.
Features
- YAML Templates -- define complex image layouts in readable YAML format
- Full CSS Flexbox -- direction, wrapping, justify, align, grow/shrink/basis, min/max constraints, auto margins
- RTL Support -- right-to-left layout with
text-direction: rtl, logical alignment (start/end), row mirroring - Template Engine -- variables (
{{name}}), loops (type: each), conditionals (type: ifwith 13 operators) - Rich Content -- text, images, QR codes (
FlexRender.QrCode), barcodes (FlexRender.Barcode), separators - HarfBuzz Shaping -- optional
FlexRender.HarfBuzzpackage for Arabic/Hebrew glyph shaping - Multiple Formats -- PNG, JPEG (quality 1-100), BMP (6 color modes), Raw pixels
- Per-Call Options -- antialiasing, font hinting, text rendering mode per render call
- AOT Compatible -- no reflection, works with Native AOT publishing
- CLI Tool -- render, validate, watch, and debug templates from the command line
Examples
| Receipt | Dynamic Receipt | Ticket | Label |
|---|---|---|---|
<details> <summary>Feature Showcase (click to expand)</summary>
</details>
Installation
# All-in-one package
dotnet add package FlexRender
# CLI tool
dotnet tool install -g flexrender-cli
Linux / Docker: Add
SkiaSharp.NativeAssets.Linuxto avoidDllNotFoundException: libSkiaSharp. For HarfBuzz text shaping, also addHarfBuzzSharp.NativeAssets.Linux.
Quick Start
1. Create a template (receipt.yaml):
canvas:
fixed: width
width: 300
background: "#ffffff"
layout:
- type: flex
padding: 20
gap: 10
children:
- type: text
content: "{{shopName}}"
font: bold
size: 1.5em
align: center
- type: each
array: items
as: item
children:
- type: flex
direction: row
justify: space-between
children:
- type: text
content: "{{item.name}}"
- type: text
content: "{{item.price}} $"
- type: text
content: "Total: {{total}} $"
font: bold
align: right
2. Render with code:
var render = new FlexRenderBuilder()
.WithSkia(skia => skia.WithQr().WithBarcode())
.Build();
var data = new ObjectValue
{
["shopName"] = "My Shop",
["total"] = 1500,
["items"] = new ArrayValue(
new ObjectValue { ["name"] = "Product 1", ["price"] = 500 },
new ObjectValue { ["name"] = "Product 2", ["price"] = 1000 })
};
byte[] png = await render.RenderFile("receipt.yaml", data);
3. Or use the CLI:
flexrender render receipt.yaml -d data.json -o receipt.png
Documentation
| Page | Description |
|---|---|
| Getting Started | Installation, first template, rendering approaches |
| Template Syntax | Canvas, all 8 element types, common properties |
| Element Reference | Complete property reference for all element types |
| Template Expressions | Variables, loops, conditionals |
| Flexbox Layout | Direction, justify, align, wrapping, grow/shrink |
| Render Options | Per-call antialiasing, font hinting, format options |
| CLI Reference | Commands, options, AOT publishing |
| API Reference | IFlexRender, builder, DI, types |
| Contributing | Build, test, architecture, conventions |
For LLM Agents
llms.txt-- concise project overview (~200 lines)llms-full.txt-- comprehensive reference (~600 lines)AGENTS.md-- build commands, coding conventions
License
MIT
| 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 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
- FlexRender.Core (>= 0.4.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
-
net8.0
- FlexRender.Core (>= 0.4.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FlexRender.DependencyInjection:
| Package | Downloads |
|---|---|
|
FlexRender
All-in-one FlexRender package. Linux/Docker: add SkiaSharp.NativeAssets.Linux to your project. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.8.0 | 86 | 2/12/2026 |
| 0.7.2 | 305 | 2/11/2026 |
| 0.7.1 | 100 | 2/11/2026 |
| 0.7.0 | 102 | 2/11/2026 |
| 0.6.0 | 109 | 2/10/2026 |
| 0.5.2 | 112 | 2/10/2026 |
| 0.5.1 | 102 | 2/10/2026 |
| 0.5.0 | 102 | 2/10/2026 |
| 0.4.1 | 108 | 2/7/2026 |
| 0.3.1 | 122 | 2/6/2026 |
| 0.3.0 | 106 | 2/5/2026 |
| 0.2.0 | 130 | 2/5/2026 |
| 0.1.0 | 113 | 2/5/2026 |
| 0.0.4 | 107 | 2/4/2026 |
| 0.0.3 | 158 | 2/4/2026 |