Skip to content

A demo porject to show how to create a UI component Library and take advantage of CSS isolation.

License

Notifications You must be signed in to change notification settings

CodingWithDavid/BlazorOwnComponetLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo on how to create a UI component in Blazor.

This project was created to show how to create your own UI component library and call it with in a Blazor application. I used a web assembly project but everything would work the same for a Server Side project.

by David Gallivan

Why

I was reviewing some sample projects and I notice they had to add a css link for each style sheet file they used with in the UI components. It got me wondering

"If your UI components are in a different assembly and you used CSS isolation, do you need to include the link to the _content style sheet in the main program index file?"

Getting Started

  1. Clone this repository

    git clone https://github.com/CodingWithDavid/BlazorOwnComponetLib
    cd BlazorOwnComponetLib
  2. Open in Visual Studio or Visual Code a. With Visual Code you will need to install the C# extensions

  3. Press F5

What's in the App

  1. Basic web assembly template project a. The counter page was removed
  2. A component library that contains a "Spinner" component a. This is a simple loader component used to demonstrate the idea of using CSS isolation in a component library
  3. A clone of the Blazor app that uses a Nuget Package
  4. The Componet lib as a nuget package

Problems or Suggestions

Open an issue here

Thank You

Resources

About

A demo porject to show how to create a UI component Library and take advantage of CSS isolation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published