# dotnet new Templates

Source: https://lumeo.nativ.sh/docs/templates

# dotnet new Templates

Lumeo ships a NuGet package of `dotnet new` item templates so you can scaffold pages, forms, and components that follow the conventions described in these docs without copy-pasting boilerplate. The package is called `Lumeo.Templates`.

## Install

Install the templates globally on your machine:

dotnet new install Lumeo.Templates

After install, `dotnet new list lumeo` will list the three item templates below. To remove them, run `dotnet new uninstall Lumeo.Templates`.

## lumeo-page

Scaffolds a new `.razor` page with an `@page` directive, a `Stack` layout, a heading, and a starter `Card` with a `Button`.

### Command

dotnet new lumeo-page --name Dashboard --route dashboard

### Produces `Dashboard.razor`

@page "/dashboard" <PageTitle>Dashboard</PageTitle> <Stack Gap="6"> <Stack Gap="2"> <Heading Level="1" Size="3xl">Dashboard</Heading> <Lumeo.Text Size="base" Color="muted"> Replace this with your page description. </Lumeo.Text> </Stack> <Card> <CardHeader><Heading Level="3">Get started</Heading></CardHeader> <CardContent> <Button Variant="Button.ButtonVariant.Default" OnClick="HandleClick">Click me</Button> </CardContent> </Card> </Stack>

### Parameters

Name

Description

Default

`--name`

Page class name (PascalCase).

`NewPage`

`--route`

URL route, without leading slash.

`new-page`

## lumeo-form

Scaffolds a POCO model annotated with `[LumeoForm]` plus a page that renders the generated form. See [\[LumeoForm\] Generator](docs/lumeo-form) for the underlying source generator.

### Command

dotnet new lumeo-form --ModelName Feedback --PageName FeedbackPage --route feedback

### Produces `FeedbackModel.cs`

using System.ComponentModel.DataAnnotations; using Lumeo; \[LumeoForm(Title = "Feedback", SubmitLabel = "Submit")\] public partial class FeedbackModel { \[Required, Display(Name = "Name")\] public string Name { get; set; } = string.Empty; \[Required, EmailAddress, Display(Name = "Email")\] public string Email { get; set; } = string.Empty; \[Display(Name = "Message")\] public string? Message { get; set; } }

### Parameters

Name

Description

Default

`--ModelName`

Model class name (PascalCase).

`ContactForm`

`--PageName`

Page class name (PascalCase).

`ContactFormPage`

`--route`

Page route, without leading slash.

`contact`

## lumeo-component

Scaffolds a reusable `.razor` component following Lumeo conventions — an explicit `@namespace`, `Class`, `AdditionalAttributes`, `ChildContent`, and theme-aware CSS variables for background and border.

### Command

dotnet new lumeo-component --ComponentName Hero --namespace MyApp.Components

### Produces `Hero.razor`

@namespace MyApp.Components <div class="@CssClass" @attributes="AdditionalAttributes"> @ChildContent </div> @code { \[Parameter\] public RenderFragment? ChildContent { get; set; } \[Parameter\] public string? Class { get; set; } \[Parameter(CaptureUnmatchedValues = true)\] public Dictionary<string, object>? AdditionalAttributes { get; set; } private string CssClass => $"rounded-lg border border-border/40 bg-card p-4 {Class}".Trim(); }

### Parameters

Name

Description

Default

`--ComponentName`

Component name (PascalCase).

`MyComponent`

`--namespace`

Target namespace.

`MyApp.Components`
