Skip to content

Repository files navigation

SumerUI

A type-safe, fluent C# library for generating static HTML with Tailwind-inspired utilities.

Features

  • 🎨 Fluent API - Chainable methods for building HTML
  • 🔒 Type-safe - No magic strings, full IntelliSense support
  • 🎯 Tailwind-inspired - Familiar utility-first approach
  • 📦 Static site generation - Export to HTML files for CDN deployment
  • 🚀 Zero JavaScript - Pure server-side rendering
  • Typst source rendering - Reuse element trees for static print-oriented documents

Quick Start

using SumerUI.Elements;
using SumerUI.Generators;
using static SumerUI.Elements.HtmlElements;

// Create a page
var page = Div()
    .Flex()
    .ItemsCenter()
    .JustifyCenter()
    .Padding(2.Rem())
    .BackgroundColor(Color.Emerald50)
    .Content(
        H1().Text("Hello, SumerUI!").FontBold().Text2Xl()
    );

// Generate static site
var generator = new StaticSiteGenerator("./out");
await generator.GeneratePageAsync("/", page);

Typst Source

using SumerUI.Renderers;

var renderer = new TypstRenderer();
var source = renderer.RenderToString(page);

foreach (var diagnostic in renderer.Diagnostics)
{
    Console.WriteLine($"{diagnostic.Code}: {diagnostic.Message}");
}

TypstRenderer emits Typst source; it does not compile PDFs. It maps static document styling and reports diagnostics when browser-only behavior such as responsive rules, hover states, scripts, or animations is omitted.

Installation

dotnet add package SumerUI
dotnet add package SumerUI.Renderers
dotnet add package SumerUI.Generators

Examples

See examples/ for complete examples:

Documentation

Contributing

Contributions welcome! See CONTRIBUTING.md

License

MIT

Releases

Contributors

Languages