Classes and enums to generate Adaptive Card elements
Definitions are generated from the schema.
Most of the classes are available in the AdaptiveCard
namespace:
AdaptiveCard/AdaptiveCard
for the main cardAdaptiveCard/Colors
to fiddle with some colors- Etc..
Some more specific elements are in their own namespaces, like the actions and the inputs:
AdaptiveCard\Action\OpenUrl
to open an URL when clickedAdapticeCard\Input\Text
to ask for some text- Etc..
All elements can be found here: https://adaptivecards.io/explorer/, everything should be available -- the elements are generated directly from the manifest/schema.
All elements also have a static method to quickly create a single element:
make
.
$card = new AdaptiveCard\AdapticeCard();
$card->body = [AdaptiveCard\TextBlock::make(text: 'Hello world!')];
$card->actions = [
AdapticeCard\Action\OpenUrl::make(
title: 'Website',
url: 'https://www.workplacebuddy.com/',
),
];