This library, initially designed as a Razor Class Library for Blazor components,
draws inspiration from the library and integrates TailwindCSS.
A unique approach was taken by converting the project into a "dotnet tool" to address challenges
arising during the compilation of the NuGet package. Unlike conventional setups, where only ".dll" files are generated,
this library ensures the presence of ".razor" files within the source code.
This adjustment facilitates TailwindCSS in compiling the essential CSS classes embedded in the library.
The methodology used is like the technique used by shadcn for TypeScript,
allowing for seamless integration and efficient template scaffolding directly within the project.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
To integrate Blazor.DaisyUI into your Blazor project, follow these simple steps:
NuGet Package Manager Console:
- NuGet Package Manager Console:
Install-Package Blazor.DaisyUI
- .NET CLI:
If you prefer the command line, use the .NET CLI:
dotnet add package Blazor.DaisyUI
Import the namespace inside your _Imports.razor
This will automatically download and install the latest version of Blazor.DaisyUI into your project, along with any necessary dependencies.
@using Blazor.DaisyUI
and inject the services inside the Dependency Injection Container in Project.cs
using Blazor.DaisyUI;
builder.Services.AddDaisyUi();
Lastly, install the tool to scaffold the templates inside your project
dotnet tool install Blazor.DaisyUI.Tool --global
To scaffold the templates inside your project use the next command, inside the folder with the blazor project
daisyui generate alert
This will generate the Alert.razor
inside your Components/UI
folder with the namespace, all the using needed and the required dependencies
For more examples, please refer to the Documentation
- Templating all the simple components
- Templating all the complex components
- Adding most used custom components
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Koja Dennis - @Denny093 - k.denny2000@gmail.com
Project Link: https://github.com/Denny09310/Blazor.DaisyUI