
Razor directives are special instructions prefixed with @ that control how a component compiles, behaves, and interacts with the framework.
@page "/route" — defines a navigable route for the component@code { } — C# code block for fields, properties, and methods@inject TypeName Identifier — injects a DI service@using Namespace — adds a using statement@inherits BaseClass — sets a base class for the component@implements IInterface — declares an interface implementation@attribute [Attribute] — applies a C# attribute to the component class@typeparam T — makes the component generic@layout LayoutName — overrides the default layout@namespace MyApp.Pages — sets the component namespace@rendermode — sets the render mode (Blazor 8+)Add common @using and @inject statements to _Imports.razor — they apply to all components in the same folder and subfolders. This eliminates repetitive using statements at the top of every file.
Reference:
TaskLoco™ — The Sticky Note GOAT