Headless UI Components for Blazor.
Note This repository is now archived. All future development will take place in Pure Blazor Components.
- Why Makani
- Getting Started
- Contributing
- Live Documentation
- Roadmap & Components
Makani was born based on the need for lightweight, performant, and customizable UI components for .NET MAUI Blazor. Makani is built on the wonderful CSS framework, Tailwind CSS. While a simple theme will be included, the hope is that the community is able to customize the theme to fit their needs.
The main focus of the Makani library is to provide a powerful set of components that work flawlessly with .NET MAUI Blazor.
- Built first and foremost for .NET MAUI Blazor
- Components should be easy to customize
- Components should be composable, extensible, and performant
- Always listen to the community
⚠️ This library is currently under active development. You may experience bugs, breaking changes, or missing functionality.
1. Install via NuGet
dotnet add package Makani
2. Update your _Imports.razor
@using Makani
3. Add Makani
builder.Services.AddMakani();
4. Add Static Assets
<head>
<link href="_content/Makani/dist/makani.css" rel="stylesheet" />
</head>
5. Build away!
<MkButton Color="MkColor.Primary">Hello world!</MkButton>
The syntax highlighting component is an optional feature. If you don't need this feature, skip this section and avoid loading the additional resources.
Makani is using Prism for syntax highlighting, so if you need this component, a few more steps are needed.
In your index.html
, add only one of the following themes to the <head>...</head>
section:
<!-- vscode-dark-plus is the one used in the Makani docs -->
<link href="_content/Makani/css/vscode-dark-plus.css" rel="stylesheet" />
<!--<link href="_content/Makani/css/atom-dark.css" rel="stylesheet" />
<link href="_content/Makani/css/coy.css" rel="stylesheet" />
<link href="_content/Makani/css/okaidia.css" rel="stylesheet" />
<link href="_content/Makani/css/tomorrow-night.css" rel="stylesheet" />-->
Add the following JS to the end of the <body>...</body>
section:
<script src="_content/Makani/prism.js"></script>
At the core of this library is the ability to customize components using Tailwind CSS. For further customization, extra steps are required:
- Install the Tailwind CLI
In the wwwroot
of your application, follow the Tailwind CLI installation
- Configure
.razor
and yourindex.html
files intailwind.config.js
Example
module.exports = {
content: ["../**/*.razor", "../*.razor", "index.html"],
theme: {
extend: {},
},
plugins: [],
}
- Update your
.csproj
file to run the Tailwind CLI
Example
<Target Name="NpmInstall" BeforeTargets="BeforeBuild">
<Exec WorkingDirectory="wwwroot" Command="npm install" />
</Target>
<Target Name="Tailwind" DependsOnTargets="NpmInstall" BeforeTargets="Build">
<Exec WorkingDirectory="wwwroot" Command="npx tailwindcss -i app.css -o ./dist/styles.css" />
</Target>
- Add the CSS to your
index.html
<head>
<link href="dist/styles.css" rel="stylesheet" />
</head>
Providing a lightweight and performant component library is a major goal of this project.
Area | Target | Actual | Passing |
---|---|---|---|
DLL Size | 200kb | 26.4kb | ✔️ |
JS Bundle Size | 10kb | 392b | ✔️ |
CSS Bundle Size | 50kb | 4.6kb | ✔️ |
Time to Interactive | 1s | 0.6s | ✔️ |
Total Blocking Time | 200ms | 140ms | ✔️ |
Cumulative Layout Shift | 0 | 0 | ✔️ |
First Contentful Paint | 0.5s | 0.3s | ✔️ |
RAM Usage | TBD | ||
CPU Usage | TBD | ||
First Input Delay | TBD |
The targets specified are only initial estimates and are open to change over time based on a reasonable standard.
Sources
- https://blog.openreplay.com/top-metrics-you-need-to-understand-when-measuring-front-end-performance
- https://developer.mozilla.org/en-US/docs/Learn/Performance/Measuring_performance
A UI component library isn't helpful if it isn't useful to everyone.
TBD
We encourage you to contribute! People of all ages / occupations / experience are welcome.
Please read the Contribution Guidelines for how to proceed.