a Razor component library for Blazor, inspired by the shadcn/ui components.
Download the NuGet package Sysinfocus.AspNetCore.Components
to your project.
Add @using Sysinfocus.AspNetCore.Components
to your _import.razor
file.
Add builder.Services.AddSysinfocus("your-license-key");
to your Program.cs
file. If you don't have license key, leave it empty and it will be treated as Trial version.
Add the following CSS to your project's appropriate file as this depends upon the type of project being used.
/// For .NET 8
<link rel="stylesheet" href="https://github.com/Sysinfocus/simple-ui/blob/master/_content/Sysinfocus.AspNetCore.Components/styles.css" />
<link rel="stylesheet" href="https://github.com/Sysinfocus/simple-ui/blob/master/_content/Sysinfocus.AspNetCore.Components/Sysinfocus.AspNetCore.Components.bundle.scp.css" />
/// For .NET 9
<link rel="stylesheet" href="https://github.com/Sysinfocus/simple-ui/blob/master/@Assets["_content/Sysinfocus.AspNetCore.Components/styles.css"]" />
<link rel="stylesheet" href="https://github.com/Sysinfocus/simple-ui/blob/master/@Assets["_content/Sysinfocus.AspNetCore.Components/Sysinfocus.AspNetCore.Components.bundle.scp.css"]" />
Add the following initialization code to your MainLayout.razor
or any layout file which you host the components.
@inherits LayoutComponentBase
@inject Initialization init
<div @onclick="init.HandleMainLayoutClickEvent"> // this is required for some components to close on click outside of its hosting component.
@Body
</div>
@code
{
protected override async Task OnAfterRenderAsync(bool firstRender)
{
// This initializes the theme for the components.
// Then you can use init.ToggleTheme() to toggle between light and dark modes.
if (firstRender) await init.InitializeTheme();
}
}
For non-interactive Blazor SSR, you need to add the light
or dark
class to body
tag manually as it can't initialize automatically.
For more information, you can download the samples from this repo which has all these steps done and the projects are ready to explore.
To see the demo of each component, check out Demo GitHub Repo
Release notes for Version 0.0.1.9
Release notes for Version 0.0.1.8
Release notes for Version 0.0.1.7
ClearState
and PopFromState
methods for StateManager
to clear memory.Release notes for Version 0.0.1.6
PreloadJSAndCSSDependencies
method of the Initialization
class. This needs to be called in the Layouts.Release notes for Version 0.0.1.5
jsCssFromCDN
parameter and set it to true
, which toggle's this feature. Release notes for Version 0.0.1.4
Release notes for Version 0.0.1.3
Release notes for Version 0.0.1.2
OnMarkerMoved
for Maps component.DistanceKilometers
and DistanceMiles
methods to get distance between 2 locations in Geolocation component.Release notes for Version 0.0.1.1
For more information, you can download the samples from this repo which has all these steps done and the projects are ready to explore. To see the demo of each component, check out Demo GitHub Repo
Open an issue on this repo or email to issues@sysinfocus.com