
DynamicComponent lets you render a component type determined at runtime — useful for plugin architectures, configurable dashboards, wizard steps, and any scenario where the component type is not known at compile time.
<DynamicComponent Type="componentType" Parameters="parameters" />
@code {
private Type componentType = typeof(WeatherWidget);
private Dictionary<string, object>? parameters = new()
{
{ "City", "New York" }
};
}private void ShowChart() => componentType = typeof(SalesChart);
private void ShowTable() => componentType = typeof(SalesTable);Always validate that the resolved Type is a known safe component before rendering it — especially if the type name comes from user input or external config.
Reference:
TaskLoco™ — The Sticky Note GOAT