Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

adaptivecards

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adaptivecards

Adaptive Cards Javascript library for HTML Clients

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is adaptivecards?

The adaptivecards npm package allows developers to create and render adaptive cards, which are a way to present and collect information in a consistent and visually appealing manner across different platforms. Adaptive cards are used in various applications like chatbots, messaging apps, and other interactive user interfaces.

What are adaptivecards's main functionalities?

Creating Adaptive Cards

This feature allows you to create an adaptive card with a simple text block and a submit button. The JSON structure defines the card's content and actions.

{
  "type": "AdaptiveCard",
  "version": "1.0",
  "body": [
    {
      "type": "TextBlock",
      "text": "Hello World!"
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Submit"
    }
  ]
}

Rendering Adaptive Cards

This feature allows you to render an adaptive card in a web application. The code parses the card JSON and appends the rendered card to the document body.

const AdaptiveCards = require('adaptivecards');
const adaptiveCard = new AdaptiveCards.AdaptiveCard();
adaptiveCard.parse({
  "type": "AdaptiveCard",
  "version": "1.0",
  "body": [
    {
      "type": "TextBlock",
      "text": "Hello World!"
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Submit"
    }
  ]
});
const renderedCard = adaptiveCard.render();
document.body.appendChild(renderedCard);

Handling User Input

This feature allows you to handle user input and actions within the adaptive card. The code sets up an event listener for when an action is executed, logging the action to the console.

adaptiveCard.onExecuteAction = function(action) {
  console.log('Action executed:', action);
};

Other packages similar to adaptivecards

Keywords

FAQs

Package last updated on 23 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc