Hello World recipe
Source: 01_HelloWorld/ · the smallest meaningful Curiosity Studio page.
How it looks
A title bar, a short intro, and a row of navigation buttons. The runnable preview below builds the same page with Tesserae alone: a Hub with the body as its section. The live recipe also wires the buttons to Router.Navigate(...).
What it teaches
- Registering a route with
Router.Register("#/recipe/hello-world", state => App.ShowDefault(new HelloWorldView(state)))— seeApp.cs. - Putting the content in a
Hub(Hub("Hello World", "#/recipe/hello-world")) so the page gets the workspace's breadcrumb header, with the page name linking back to its route. - Stacking Tesserae components (
VStack,HStack,TextBlock,Button,Icon) with the fluent style. - Triggering navigation between recipes with
Router.Navigate(...).
View skeleton
public sealed class HelloWorldView : IComponent
{
private readonly IComponent _container;
public HelloWorldView(Parameters state)
{
var body = VStack().WS().Children(
TextBlock("Welcome to the recipes").Large().SemiBold(),
TextBlock("Each page in this front-end is a single component returned from a route.")
.Secondary(),
HStack().Children(
Button("Open SearchArea recipe").Primary().SetIcon(UIcons.Search)
.OnClick(() => Router.Navigate("#/recipe/search-area")),
Button("Back to recipe catalog").SetIcon(UIcons.Home)
.OnClick(() => Router.Navigate(DefaultRoutes.Home))
).PT(16)
).P(16);
_container = Hub("Hello World", "#/recipe/hello-world")
.Section(body, grow: true);
}
public HTMLElement Render() => _container.Render();
}
Reuse notes
- The same shape is used by every other recipe — they all return an
IComponentfrom a factory registered inApp.cs. - For data-driven pages, swap the static body for a
Defer(async () => ...)block — see the Dashboards recipe. - For richer page chrome, add crumbs with
.Crumb(...)and buttons on the right with.Commands(...)(see Hub), or seeMosaik.FrontEnd.LicenseServer/src/LicensesView.csin the Mosaik repo.