Live Chat Icon For mobile
Live Chat Icon

Blazor FAQ - Component libraries

Find answers for the most frequently asked questions
Expand All Collapse All

You can consume a library in either of two ways:

  • Full name with namespace
  • Using Razor’s @using directive

If the MyComponentLib is the component library and MyComponent is the component name, those are consumed like in the following.

Option 1

<h1>Hello, world!</h1>

Welcome to your new app.

<MyComponentLib.MyComponent />

Option 2

@using MyComponent

<h1>Hello, world!</h1>

Welcome to your new app.

<MyComponent />

Refer to the link Consume Blazor a library component.

Permalink

Share with

Couldn't find the FAQs you're looking for?

Please submit your question and answer.