Git Product home page Git Product logo

megabit / blazorise Goto Github PK

View Code? Open in Web Editor NEW
3.1K 77.0 506.0 74.46 MB

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.

Home Page: https://blazorise.com/

License: Other

HTML 5.80% C# 57.81% JavaScript 2.27% CSS 22.32% Batchfile 0.09% SCSS 11.71%
blazorise blazor components bootstrap material bulma datagrid charts antdesign bootstrap4

blazorise's Introduction

Blazorise

Components for Blazor

NuGet Nuget Discord License Tip Me via PayPal Patreon

Blazorise is the only Blazor component library offering development independent of CSS frameworks, exclusively using C#. It provides support for various frameworks including Bootstrap, Tailwind and Material.

Commercial usage

Blazorise, as a commercial product, offers a range of subscription plans that include premium support. When you choose a commercial license, you gain several advantages:

The benefits of the commercial licenses are:

* Some features may be exclusive to specific subscription tiers.

Supporting Blazorise

Blazorise is an open source project with its ongoing development made possible entirely by the support of these awesome backers.

Special Partners

Demos

Blazor WebAssembly

Blazor Server

Documentation

For full documentation, with code samples and a detailed explanation of each component please visit the Blazorise official documentation pages.

Continuing reading below for a quick start guide.

Installations

Prerequisites

Before you continue, please make sure you have the latest version of Visual Studio and .NET installed. Visit an official Blazor site to learn more.

Available packages

There are currently 6 different NuGet packages for each of the supported CSS frameworks.

Available Blazorise packages are:

1. Blazorise.Tailwind
2. Blazorise.Bootstrap
3. Blazorise.Bootstrap5
4. Blazorise.Bulma
5. Blazorise.Material
6. Blazorise.AntDesign
7. Blazorise.FluentUI2

This guide will show you how to setup Blazorise with Bootstrap 5 and FontAwesome 6 icons. To setup Blazorise for other CSS frameworks, please refer the Usage page in the documentation.

1. NuGet packages

First step is to install a Bootstrap 5 provider for Blazorise:

dotnet add package Blazorise.Bootstrap5

And FontAwesome icon package:

dotnet add package Blazorise.Icons.FontAwesome

2. Source files

Add the following to index.html (Blazor WebAssembly), or _Host.cshtml (Blazor Server), or App.razor (.NET 8) in the head section.

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<link href="_content/Blazorise.Icons.FontAwesome/v6/css/all.min.css" rel="stylesheet">

<link href="_content/Blazorise/blazorise.css?v=1.5.2.0" rel="stylesheet" />
<link href="_content/Blazorise.Bootstrap5/blazorise.bootstrap5.css?v=1.5.2.0" rel="stylesheet" />

Please note, that these are the Blazorise explicit dependencies, you still need to add framework specific dependencies.

2.1 JavaScript resources

Blazorise loads any additional JavaScript it needs dynamically once a component needs it. This means that Blazorise expects that the resources are available and placed relative to the app root. You can configure this by using the app.UseStaticFiles(); and it does not need any other additional configuration from your part.

If you're having any difficulties, please refer to the following issues:

We are also aware that there might need to be extra setup when dealing with PWA and offline capabilities if you want your app to remain responsive. Please check our PWA docs for more information.

3. Using's

In your main _Imports.razor add:

@using Blazorise

4. Registrations

Add the following lines to the relevant sections of Program.cs.

using Blazorise;
using Blazorise.Bootstrap5;
using Blazorise.Icons.FontAwesome;
builder.Services
  .AddBlazorise()
  .AddBootstrap5Providers()
  .AddFontAwesomeIcons();

Usage

@page "/counter"

<Heading Size="HeadingSize.Is1">Counter</Heading>

<Paragraph>Current count: @currentCount</Paragraph>

<Button Color="Color.Primary" Clicked="IncrementCount">Click me</Button>

@code {
    int currentCount = 0;

    void IncrementCount()
    {
        currentCount++;
    }
}

Development version

We release a development version of Blazorise on a regular basis. This version is available on the MyGet feed. This release is not recommended for production use, but it's a great way to test the latest features, bug fixes and gives us some feedback ahead of the upcoming release.

Contributing

We welcome contributions and any suggestions or feature requests you might have. Contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. This will be signed once you submit a PullRequest on our repository. For details about our CLA, please visit: Contributor License Agreement.

For our code conventions and guidelines please visit: Contributing Guide

blazorise's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blazorise's Issues

Component Id generator performance

This might be related => #22 .

Is there a possibility to opt out of element Id generation? It's not noticeable on small number of components, but on large number of generated components impact on performance is huge.

From my tests, rendering Fields / Form like component 500 times takes 12-13 seconds, vs 1-2 sec for just using plain bootstrap for same stuff. I'm guessing that's because you calculate and set new Id on some elements each time component is re-rendered.

Safari rendering issues

I noticed that on Safari browser rendering of some elements is not correct. Breadcrumbs are rendered other 2 lines (same on demo project). And table row heights are indirect if the table is not full length. I think there is some issue with padding.

Chart Options Issue?

Hi There!
Sorry to be a pain, Im trying to instantiate a similar chart to below in chartjs using your charts package:
https://codepen.io/Shywim/pen/xXYror
So i have the following code:

        protected LineChartOptions chartOptions = new LineChartOptions()
        {
            Tooltips = new Tooltips() {Enabled = false},
            Legend = new Legend(){Display = false},
            Scales = new Scales()
            {
                YAxes = new List<Axe>()
                {
                    new Axe(){Display = false}
                },
                XAxes = new List<Axe>()
                {
                    new Axe(){Display = false}
                }
            },
        };

If i remove the Scales object - the chart renders with my data correctly.
However the chart doesnt render at all with any of the Scale objects.
The other issue is that we are missing the elements object as far as i can see anyway?
Other than that its working great - thank you!
(FYI this is in v 0.5.1)

Move Icon to a separate project

Icons should be moved to a new project and be available as an extension for Blazorise.

Also icons should be separated further for each icon pack. eg:

  • Blazorise.Icons (base project)
  • Blazorise.Icons.FontAwesome
  • Blazorise.Icons.Material
  • Blazorise.Icons.Iconic

etc

Remove external JS library for Date input

Remove gijgo.js and optimize date input to use native date picker.

If there is a need for external library for date input, then in that case it should be created as an Extension and registered as custom date picker inside of Blazorise.

Refactor providers registration

Rigth now the AddMaterialProviders and AddBootstrapProviders are doing more than they should. They should only do a registrations to the Blazorise.

Create new methods like UseBootstrapProviders, UseMaterialProviders etc to do the custom work when adding the providers.

Dependencies ?

Are dependencies for this 0.7.0 (AspNetCore.Blazor.Build and AspNetCore.Blazor.Browser)?
I'm trying to run default client side Blazor template with Blazorise.Bootstrap package but something is exploding in Blazor.MonoRuntime.targets.

Also there's no AddIconProvider().

Add TextEdit.Step

May be to add a property TextEdit.Step.
With this property, you will be able to write a decimal number using Role="TextRole.Number".

Components should be case sensitive

This is planned to be done after the release of Blazor with .Net Core 3.0. See an issue #5500 on AspNetCore.

The problem is mainly that we cannot have components that are named Button, Form, etc because they are messing with the native html tags.

Version 1.0 of Blazorise will be released ONLY AFTER this is implemented.

Refactor Sidebar project

Sidebar is currently not using much of a Blazorise internal components. It needs to be refactored in a way that it should be using Bar, BarItem etc. That way it will work better with different css framework providers.

NumericEdit

How to bind with nullable decimal properties?
TextEdit supports string only.
Is there no equivalent DateEdit control for numbers?

Convert Action to EventCallback

EventCallback is introduced in new RC and in the Blazor 0.9. They're used to better handle events for components.

Problem

When RC raises the "change" event it also calls the StateHasChanged for all of the components on currently opened page. This is not good because it will also force Blazorise to re-render which can greatly damage the performance. One way to fix this is to override ShouldRender and only render what is actually changed.

NavBars

This is extraordinary. Well done.

Do you plan to do Navbars?

Documentation for Modal

I know docs are a work in progress but I'm determined to test every part of this.

Do you think you could throw something together?

Thanks.

(Incidentally, my app is now looking absolutely lovely).

Rename boolean attributes

Currently all of the boolean attributes have a prefix Is*. Try to see if there is better way for naming boolean-type attributes. eg:

Currently Wanted
IsReadonly Readonly
IsDisabled Disabled
IsInline Inlined

Dynamic Modal Render?

Consider this:

<Fields>
    <Field ColumnSize="ColumnSize.Is1.OnDesktop">
        <TextEdit IsReadonly="true" Text="@Name" />
    </Field>
    <Field>
        <SimpleButton Color="Color.Danger" Clicked="Remove">Remove</SimpleButton>
    </Field>
    <Field>
        <SimpleButton Color="Color.Warning" Clicked="Show Modal">Edit</SimpleButton>
    </Field>
</Fields>

<Modal ref="modalRef">
    <ModalBackdrop />
    <ModalContent IsCentered="true">
        <ModalHeader>
            <ModalTitle>Edit</ModalTitle>
            <CloseButton Clicked="@HideModal" />
        </ModalHeader>
        <ModalBody>
            <Field>
                <FieldLabel>@Name</FieldLabel>
                <TextEdit Placeholder="Enter name..." />
            </Field>
        </ModalBody>
        <ModalFooter>
            <SimpleButton Color="Color.Secondary" Clicked="@HideModal">X</SimpleButton>
            <SimpleButton Color="Color.Primary" Clicked="@HideModal">Save</SimpleButton>
        </ModalFooter>
    </ModalContent>
</Modal>
@functions
{
    private Modal modalRef;
    [Parameter]
    private string Name { get; set; }
}

Lets say i have to loop these to show them in table.
But using this in for loop in some other component will create hidden modal for each item. Now correct me if i'm wrong but, there's no way to create single modal as generic component and then just pass modal ref and other parameters on click event , right?

So would it be possible to just dynamically render it like this:

@functions {
    RenderFragment ModalProperty { get; set; }
     private Modal modal;
    
        RenderFragment CreateDynamicComponent() => builder =>
    {
        builder.OpenComponent(0, typeof(CustomGenericModal));
        builder.AddAttribute(1, "modalRef", modal);        
        builder.AddAttribute(2, "Name", @Name);          
        builder.CloseComponent();
    };       
    void SetModalPropertyOnClick()
    {
       ModalProperty = CreateDynamicComponent();
    }
}

This way each item would have empty RenderFragment ModalProperty { get; set; }. But modal would only render on click by invoking component dynamically and setting ModalProperty .

Improve documentation

Make the separate documentation pages for every component instead of grouping them by categories(buttons, forms,...)

Update Blazorise to the new Razor Components

NET Core 3.0 preview 2 is now released and Blazorise should be updated to the latest version of Razor Components. There are two options now.

  • Wait for the Razor Components to exit preview version
  • Upgrade now and keep track of any changes as they go

Cannot instantiate implementation type 'Blazorise.JSRunner' for service type 'Blazorise.IJSRunner

Hi there! First of all thank you for your time on these components!
I followed the below steps:

  1. Create a new Server Side Blazor App using Blazor 0.7.0
  2. In the Client Project, add the nuget package Blazorise.Charts
  3. Added the following lines to the _ViewImports.cshtml file:
    @using Blazorise.Charts @addTagHelper *, Blazorise.Charts
  4. Added the following lines to the Client Projects Startup.cs file:
    services.AddSingleton<IJSRunner, JSRunner>(); var componentMapper = new ComponentMapper(); services.AddSingleton<IComponentMapper>(componentMapper);
  5. Build the project (Build is successful)
  6. Run the project
    This creates the following error in the browser console:

Uncaught (in promise) Error: System.ArgumentException: Cannot instantiate implementation type 'Blazorise.JSRunner' for service type 'Blazorise.IJSRunner'.

Thanks again for your awesome project!

Bar drop downs are persistent

Hi, first off let me say great work on this component library for Blazor and I intend to use this for a project at work.
I'm experiencing an issue where clicking on a bar drop down opens the dropdown and will continue to be open unless it's once again clicked. Typically the drop down should toggle itself closed if a different drop down is clicked or one of the links in the drop down is clicked.
Additionally the menu toggle button doesn't seem to work at all nor does anything work on mobile browsers.
Because of these issues I've reverted back to the native bootstrap component.
Here is how I've defined the menu bar with the dropdowns:

<Bar Breakpoint="Breakpoint.Desktop" Background="Background.Dark" Theme="Theme.Dark">
    <BarBrand>POC</BarBrand>
    <BarToggler></BarToggler>
    <BarMenu>
        <BarStart>
            <BarItem>
                <BarDropdownToggler>Home</BarDropdownToggler>
                <BarDropdown>
                    <BarDropdownItem>
                        <BarLink To="">Home</BarLink>
                    </BarDropdownItem>
                    <BarDropdownItem>
                        <BarLink To="About">About</BarLink>
                    </BarDropdownItem>
                    <BarDropdownItem>
                        <BarLink To="Counter">Counter</BarLink>
                    </BarDropdownItem>
                </BarDropdown>
            </BarItem>
            <BarItem>
                <BarDropdownToggler>Contact</BarDropdownToggler>
                <BarDropdown>
                    <BarDropdownItem>
                        <BarLink To="Contact">Contact</BarLink>
                    </BarDropdownItem>
                    <BarDropdownItem>
                        <BarLink To="Contact">Place Holder</BarLink>
                    </BarDropdownItem>
                </BarDropdown>
            </BarItem>
        </BarStart>
    </BarMenu>
</Bar>

Rendering issue with dropdown in BarEnd

...
           <BarEnd>
                    <BarDropdown>
                        <BarDropdownToggle>Test</BarDropdownToggle>
                        <BarDropdownMenu>
                            <BarDropdownItem>Profile</BarDropdownItem>
                            <BarDropdownItem>Log Out</BarDropdownItem>
                        </BarDropdownMenu>
                    </BarDropdown>
            </BarEnd>
        </BarMenu>

When I activate the drop down, the menu itself renders at the left-edge of the screen rather than under the drop down that opened the menu.

Material with Razor Components

I'm trying to use the new preview with Razor components with VS 2019 Preview + ASP.net 3.0 Preview. I followed the instructions to install the Blazorise.Material nuget packages, index.htm css and js changes, and registrations. I can add components to the default application and don't get any errors. However, I don't get any styling of any kind. Can someone give me a sample solution or step-by-step of getting Material working starting from a new Razor Components app? It looks like I'm missing something. I've tried adding references to the Material css and Material js files without any changes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.