🎓 All Courses | 📚 Blazor WASM Syllabus
Stickipedia University
📋 Study this course on TaskLoco

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.

Basic Usage

<DynamicComponent Type="componentType" Parameters="parameters" />

@code {
    private Type componentType = typeof(WeatherWidget);
    private Dictionary<string, object>? parameters = new()
    {
        { "City", "New York" }
    };
}

Switching Components at Runtime

private void ShowChart() => componentType = typeof(SalesChart);
private void ShowTable() => componentType = typeof(SalesTable);

Common Use Cases

  • Tab systems — each tab renders a different component type
  • Dashboard widgets — user-configurable grid where widget types are stored in a database
  • Form wizards — multi-step forms where each step is a separate component
  • Plugin panels — third-party components loaded by type name from configuration

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.


YouTube • Top 10
Blazor WASM: Dynamic Components
Tap to Watch ›
📸
Google Images • Top 10
Blazor WASM: Dynamic Components
Tap to View ›

Reference:

Wikipedia: Component-Based Software Engineering

image for linkhttps://en.wikipedia.org/wiki/Component-based_software_engineering

📚 Blazor WASM — Full Course Syllabus
📋 Study this course on TaskLoco

TaskLoco™ — The Sticky Note GOAT