FlexRender.Core
0.4.1
See the version list below for details.
dotnet add package FlexRender.Core --version 0.4.1
NuGet\Install-Package FlexRender.Core -Version 0.4.1
<PackageReference Include="FlexRender.Core" Version="0.4.1" />
<PackageVersion Include="FlexRender.Core" Version="0.4.1" />
<PackageReference Include="FlexRender.Core" />
paket add FlexRender.Core --version 0.4.1
#r "nuget: FlexRender.Core, 0.4.1"
#:package FlexRender.Core@0.4.1
#addin nuget:?package=FlexRender.Core&version=0.4.1
#tool nuget:?package=FlexRender.Core&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
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (10)
Showing the top 5 NuGet packages that depend on FlexRender.Core:
| Package | Downloads |
|---|---|
|
FlexRender.DependencyInjection
Microsoft.Extensions.DependencyInjection integration for FlexRender. |
|
|
FlexRender.Yaml
YAML template parsing for FlexRender. |
|
|
FlexRender
All-in-one FlexRender package. Linux/Docker: add SkiaSharp.NativeAssets.Linux to your project. |
|
|
FlexRender.Svg.Render
SVG vector output renderer for FlexRender. Generates scalable SVG from the same layout tree. |
|
|
FlexRender.Skia.Render
SkiaSharp rendering for FlexRender. Linux/Docker: add SkiaSharp.NativeAssets.Linux to your executable project. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.8.0 | 259 | 2/12/2026 |
| 0.7.2 | 516 | 2/11/2026 |
| 0.7.1 | 316 | 2/11/2026 |
| 0.7.0 | 322 | 2/11/2026 |
| 0.6.0 | 350 | 2/10/2026 |
| 0.5.2 | 454 | 2/10/2026 |
| 0.5.1 | 151 | 2/10/2026 |
| 0.5.0 | 146 | 2/10/2026 |
| 0.4.1 | 206 | 2/7/2026 |
| 0.3.1 | 226 | 2/6/2026 |
| 0.3.0 | 205 | 2/5/2026 |
| 0.2.0 | 206 | 2/5/2026 |
| 0.1.0 | 188 | 2/5/2026 |
| 0.0.4 | 192 | 2/4/2026 |
| 0.0.3 | 232 | 2/4/2026 |