S&box Wiki

Generic Components

Generics

You can make a generic razor panel class by using the @typeparam to define the name of the parameter.

@typeparam T <root> This is my class for @Value </root> @code { public T Value { get; set; } }

You will then be able to use this like a regular generics class in c#, like PanelName<string> etc.

In Razor

In Razor you will need to add a T attribute to define the type.

<root> <MyPanel T="string"></MyPanel> </root>