GithubHelp home page GithubHelp logo

fredrik0277 / blazor.adaptivecards Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikoskinen/blazor.adaptivecards

0.0 0.0 0.0 7.78 MB

Adaptive Cards for Blazor

Home Page: https://adaptivecardsblazor.com

License: MIT License

C# 79.34% HTML 5.59% JavaScript 14.62% CSS 0.44%

blazor.adaptivecards's Introduction

Introduction

Adaptive Cards for Blazor is a community project that provides Adaptive Cards support for your Blazor applications.

Adaptive Cards for Blazor Logo

Adaptive Cards are a way to exchange content in a common and consistent way. Adaptive Cards can be integrated into different applications like Microsoft Teams and Outlook. Adaptive Cards can also be integrated into custom applications built with .NET, iOS and JavaScript. And now Blazor, the new Web App platform from Microsoft is supported.

NuGet

Feature Highlights

Adaptive Cards for Blazor provides components for displaying Adaptive Cards inside your Blazor Application. Here's few of the most notable features of this library:

  • JSON-support: Create and display Adaptive Cards from the JSON-schema.
  • Templating: Combine models (objects) and the schema.
  • Card Collections: Display a list of cards based on model and use template selector to customize the output.
  • Action support: Handle Submit and OpenUrl actions using C#.
  • Native .NET-based solution: Blazor Adaptive Cards is based on the official .NET SDK for Adaptive Cards.

Project home

Adaptive Cards for Blazor's home site is located at https://adaptivecardsblazor.com/.

Project's source code is available from GitHub. GitHub can be used to report any suggestions or issues.

Requirements

Adaptive Cards for Blazor targets .NET Core 3.1. Please also note that the library has been tested with the server side version of Blazor.

Roadmap

  • October 2019: 1.0.0
  • October 2019: 1.1.0: Adds support for ToggleVisibility.
  • November 2019: 2.0.0: Adds support for .NET Core 3.1.
  • May 2020: 3.0.0-beta: Adds support for preview version of .NET 5 and adds a fully tested support for Blazor WebAssembly.
  • November 2020: 3.0.0: Adds support for RTM version of .NET 5 and fully supports both the WebAssembly and Server versions of Blazor.

Getting started

Getting Started guide is available through the project's home site.

Quick start

Add NuGet

Install-Package AdaptiveCardsBlazor

Configure Startup.cs

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddServerSideBlazor();
            
            ...

            services.AddBlazorAdaptiveCards();
        }

Configure _Imports.razor

...
@using AdaptiveCards.Blazor

Add JS interop into _Host.cshtml

    <script src="_content/AdaptiveCardsBlazor/adaptiveCardsJsInterop.js"></script>

Create the schema in Index-component

@code {
    string schema = @"{
      ""$schema"": ""http://adaptivecards.io/schemas/adaptive-card.json"",
      ""type"": ""AdaptiveCard"",
      ""version"": ""1.2"",
      ""body"": [
        {
          ""type"": ""TextBlock"",
          ""text"": ""Adaptive Cards for Blazor simple example""
        }
      ]
    }";
}

Render the card by adding component into page

        <AdaptiveCard Schema="@schema"></AdaptiveCard>

Full source code of index.razor

@page "/"

<AdaptiveCard Schema="@schema"></AdaptiveCard>

@code{
    string schema = @"{
      ""$schema"": ""http://adaptivecards.io/schemas/adaptive-card.json"",
      ""type"": ""AdaptiveCard"",
      ""version"": ""1.2"",
      ""body"": [
        {
          ""type"": ""TextBlock"",
          ""text"": ""Adaptive Cards for Blazor simple example""
        }
      ]
    }";
}

Authors

Adaptive Cards for Blazor is created by Mikael Koskinen.

Contributions are welcome!

License

Adaptive Cards for Blazor is MIT licensed. The library uses the following other libraries:

blazor.adaptivecards's People

Contributors

iambipinpaul avatar mikoskinen avatar

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.