Tesserae is a UI toolkit for building web applications entirely in C#, inspired by Microsoft's Fluent UI toolkit. It leverages the h5 C# to JavaScript compiler to provide a strongly typed, easy-to-use UI development experience.
Official Documentation: https://docs.curiosity.ai/tesserae
To create a new, blank Tesserae project from scratch, follow these steps:
-
Update or install the h5-compiler:
dotnet tool update --global h5-compiler
-
Install the h5 project templates:
dotnet new install h5.Template
-
Create a new h5 project:
dotnet new h5
-
Add the Tesserae package:
dotnet add package Tesserae
Tesserae projects are compiled from C# to JavaScript using the h5 compiler.
The build process is controlled by the h5.json file located in your project root. This file defines:
- Output Directory: Where the compiled files will be placed (e.g.,
"output": "$(OutDir)/h5/"). - Entry Point: The name of the generated JavaScript file (e.g.,
"fileName": "app.js"). - HTML Generation: Whether to generate an
index.htmlfile and its title. - Resources: Additional CSS, images, or JavaScript files to be included in the build output.
When you build the project (e.g., via dotnet build or in Visual Studio), the h5 compiler translates your C# code into JavaScript and copies necessary assets to the output folder. By default, these files are located in:
bin/Debug/netstandard2.0/h5/ (or bin/Release/... depending on your configuration).
To test your application locally, we recommend using the dotnet-serve tool, which is a simple command-line HTTP server.
-
Install dotnet-serve:
dotnet tool install dotnet-serve --global
-
Serve the compiled files: Navigate to the h5 output directory and start the server:
cd bin/Debug/netstandard2.0/h5/ dotnet serve --port 5000 -
View your app: Open your browser and navigate to
http://localhost:5000/.
Detailed guides and documentation can be found in the following sections:
The Tesserae.Tests project contains numerous examples demonstrating how to use the library components. A live version of these samples is hosted at https://curiosity.ai/tesserae.