A base component library based on the Material specification and Blazor interaction capabilities

A base component library based on the Material specification and Blazor interaction capabilities

2022-10-09 0 1,173
Resource Number 44090 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

This issue recommends MASA Blazor, a base component library that provides standards based on the Material design specification and the interaction capabilities of BlazorComponent.

A base component library based on the Material specification and Blazor interaction capabilities插图

MASA Blazor is a standard base component library based on the Material design specification and the interaction capabilities of BlazorComponent. Provides preset components for standard scenarios such as layout, popover standards, Loading, and global exception handling. Starting from more actual scenarios, meet the needs of more users and scenarios, and minimize the time cost of developers.

class=”pgc-h-arrow-right” data-track=”5″>

  • Use C# instead of JavaScript to create informative interactive UI
  • Share server-side and client-side application logic written in.NET
  • Render UI as HTML and CSS to support many browsers, including mobile
  • Integration with new hosting platforms (such as Docker)
  • Write code in C# instead of JavaScript
  • Leveraging the existing.NET library ecosystem
  • Share application logic between server and client
  • Benefit from.NET performance, reliability, and security
  • Stay productive with Visual Studio on Windows, Linux, and macOS
  • is based on a stable, feature-rich, and easy-to-use set of common languages, frameworks, and tools for generating

class=”pgc-h-arrow-right” data-track=”20″>

dependent environment

  • Install. NET SDK 6.0
  • Install Visual Studio Code or Visual Studio 2022

development environment setup

Install:

dotnet new --install  Masa.Template

Create project:

dotnet new masabp -o Masa.Test
  • Blazor WebAssembly
dotnet new masabp --mode Wasm -o Masa.TestWasm
  • Blazor RCL
dotnet new masabp --mode ServerAndWasm -o Masa.TestRcl

Run:

cd Masa.Test\Masa.Test.Server
dotnet run

A base component library based on the Material specification and Blazor interaction capabilities插图1


Existing items

Install Nuget package:

dotnet add package Masa.Blazor

< p data – track = “40” > to Masa. Blazor related services added to the Startup. ConfigureServices: < / p >

services.AddMasaBlazor(); 

Introduce styles, fonts, scripts in wwwroot/index.html(WebAssembly) or Pages/_Host.cshtml(Server) :

<html lang="en">
	<head>
		<!--Style-->
		<link href="_content/Masa.Blazor/css/masa-blazor.css" rel="stylesheet">
		<link href="_content/Masa.Blazor/css/masa-extend-blazor.css" rel="stylesheet">
		<!--Font-->
		<link href="https://cdn.jsdelivr.net/npm/@("@mdi")/font@5.x/css/materialdesignicons.min.css" rel="stylesheet">
		<link href="https://fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet">
		<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">	
	</head>
	<body>
		<!--Script (try to put it at the end of the body)-->
		<script src="_content/BlazorComponent/js/blazor-component.js"></script>
	</body>
</html>

Add namespace to _Imports.razor file :

@using Masa.Blazor
@using BlazorComponent

Modify the Shared/MainLayout.razor file to make MApp the root element:

< MApp>
	// Other layout content 
</MApp>

class=”pgc-h-arrow-right” data-track=”100″> Browser support

browser name

Support status

Chromium (Chrome, Edge Insider)

Support

Edge

Support

Firefox

Support

Safari 10+

Support

IE11/Safari 9

Support (polyfill)

IE9 / IE10

Not supported

Sample component

Alert

A base component library based on the Material specification and Blazor interaction capabilities插图2

@using AlertTypes = BlazorComponent.AlertTypes

<div>
    <MAlert Dense
            Type="AlertTypes.Info">
        I'm a dense alert with a <strong>type</strong> of info
    </MAlert>
    <MAlert Dense
            Text
            Type="AlertTypes.Success">
        I'm a dense alert with the <strong>text</strong> prop and a <strong>type</strong> of success
    </MAlert>
    <MAlert Dense
            Border="Borders.Left"
            Type="AlertTypes.Warning">
        I'm a dense alert with the <strong>border</strong> prop and a <strong>type</strong> of warning
    </MAlert>
    <MAlert Dense
            Outlined
            Type="AlertTypes.Error">
        I'm a dense alert with the <strong>outlined</strong> prop and a <strong>type</strong> of error
    </MAlert>
</div>

Avatar Picture of head

<div class="text-center" style="width:100%">
    <MAvatar Color="primary" Size="56">
        <span class="white--text">VJ</span>
    </MAvatar>
</div>

Button Push button

A base component library based on the Material specification and Blazor interaction capabilities插图3

<div class="text-center">
    <MButton class="mx-2"
             Fab
             Small
             Dark
             Color="primary">
        <MIcon>
            mdi-minus
        </MIcon>
    </MButton>

    <MButton class="mx-2"
             Fab
             Small
             Dark
             Color="pink">
        <MIcon>mdi-heart</MIcon>
    </MButton>

    <MButton class="mx-2"
             Fab
             Dark
             Color="indigo">
        <MIcon>mdi-plus</MIcon>
    </MButton>

    <MButton class="mx-2"
             Fab
             Dark
             Color="teal">
        <MIcon>mdi-format-list-bulleted-square</MIcon>
    </MButton>

    <MButton class="mx-2"
             Fab
             Dark
             Large
             Color="cyan">
        <MIcon>mdi-pencil</MIcon>
    </MButton>

    <MButton class="mx-2"
             Fab
             Dark
             Large
             Color="purple">
        <MIcon>
            mdi-android
        </MIcon>
    </MButton>
</div>

Dialog 对话框

A base component library based on the Material specification and Blazor interaction capabilities插图4

<MRow Justify="JustifyTypes.SpaceAround">
    <MCol Cols="@("auto")">
        <MDialog @bind-Value="dialog"
                 Transition="dialog-bottom-transition"
                 MaxWidth="600">
            <ActivatorContent>
                <MButton Color="primary"
                         @attributes="@context.Attrs">
                    From the bottom
                </MButton>
            </ActivatorContent>
            <ChildContent>
                <MCard>
                    <MToolbar Color="primary"
                              Dark>
                        Opening from the bottom
                    </MToolbar>
                    <MCardText>
                        <div class="text-h2 pa-12">Hello world!</div>
                    </MCardText>
                    <MCardActions Class="justify-end">
                        <MButton Text
                                 OnClick="() => dialog = false">
                            Close
                        </MButton>
                    </MCardActions>
                </MCard>
            </ChildContent>
        </MDialog>
    </MCol>
</MRow>

Tab TAB TAB

A base component library based on the Material specification and Blazor interaction capabilities插图5

<MCard>
    <MTabs BackgroundColor="deep-purple accent-4" CenterActive Dark>
        <MTab>One</MTab>
        <MTab>Two</MTab>
        <MTab>Three</MTab>
        <MTab>Four</MTab>
        <MTab>Five</MTab>
        <MTab>Six</MTab>
        <MTab>Seven</MTab>
        <MTab>Eight</MTab>
        <MTab>Nine</MTab>
        <MTab>Ten</MTab>
        <MTab>Eleven</MTab>
        <MTab>Twelve</MTab>
        <MTab>Thirteen</MTab>
        <MTab>Fourteen</MTab>
        <MTab>Fifteen</MTab>
        <MTab>Sixteen</MTab>
        <MTab>Seventeen</MTab>
        <MTab>Eighteen</MTab>
        <MTab>Nineteen</MTab>
        <MTab>Twenty</MTab>
    </MTabs>
</MCard>

Reference for more sample components:
https://blazor-wasm.masastack.com/components/alerts

—END—

Open source protocol: MIT

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code A base component library based on the Material specification and Blazor interaction capabilities https://ictcoder.com/kyym/a-basic-component-library-based-on-material-specifications-and-blazor-interaction-capabilities.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service