# Adaptive Card sample: Card Expansion

- id: `card-expansion`
- Adaptive Card schema version: 1.5

Event card with hero image, expandable description (Action.ToggleVisibility via RichTextBlock selectAction "Show more"/"Show less"), and Action.ShowCard revealing an inline registration form with Action.Submit.

## Elements

- `Container` — backgroundImage, minHeight, verticalContentAlignment, bleed
- `targetWidth` — Standard / Wide / Narrow / VeryNarrow — responsive visibility (original)
- `TextBlock` — color: Light, size: Large/ExtraLarge, weight: Bolder, isSubtle
- `RichTextBlock + TextRun` — selectAction: Action.ToggleVisibility — "Show more" / "Show less" inline
- `Action.ToggleVisibility` — targetElements: truncatedText, fullText1, fullText2, showMore, showLess
- `ActionSet` — conteneur d'actions inline dans le body
- `Action.ShowCard` — style: positive — expand inline sub-card
- `Input.Text` — isRequired, errorMessage — name & email fields
- `Action.Submit` — style: positive — soumet le formulaire d'inscription

## Card JSON

```json
{
  "type": "AdaptiveCard",
  "version": "1.5",
  "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
  "body": [
    {
      "type": "Container",
      "bleed": true,
      "backgroundImage": {
        "url": "/adaptivecard/assets/eventHero.png",
        "verticalAlignment": "Center"
      },
      "minHeight": "200px",
      "verticalContentAlignment": "Bottom",
      "items": [
        {
          "type": "TextBlock",
          "text": "MAY",
          "wrap": true,
          "color": "Light",
          "size": "Large"
        },
        {
          "type": "TextBlock",
          "text": "31",
          "wrap": true,
          "color": "Light",
          "size": "ExtraLarge",
          "spacing": "None",
          "weight": "Bolder"
        }
      ]
    },
    {
      "type": "TextBlock",
      "text": "AI",
      "wrap": true,
      "size": "Small",
      "weight": "Bolder",
      "isSubtle": true
    },
    {
      "type": "TextBlock",
      "text": "AI Reality Check: Accessibility and Personalization",
      "wrap": true,
      "weight": "Bolder",
      "spacing": "None"
    },
    {
      "type": "TextBlock",
      "text": "Fri, Aug 23, 12:00 PM",
      "wrap": true,
      "size": "Small",
      "weight": "Bolder"
    },
    {
      "type": "TextBlock",
      "text": "Online (Teams)",
      "wrap": true,
      "size": "Small",
      "isSubtle": true,
      "spacing": "None"
    },
    {
      "type": "TextBlock",
      "id": "truncatedText",
      "text": "Join us for an exciting session exploring the intersection of AI and accessibility. Discover how personalization is reshaping the digital experience…",
      "wrap": true,
      "size": "Small",
      "spacing": "Small"
    },
    {
      "type": "TextBlock",
      "id": "fullText1",
      "isVisible": false,
      "text": "Join us for an exciting session exploring the intersection of AI and accessibility. Discover how personalization is reshaping the digital experience. In this session, we'll dive deep into the latest AI-driven accessibility tools and how they are empowering users with diverse needs.",
      "wrap": true,
      "size": "Small",
      "spacing": "Small"
    },
    {
      "type": "TextBlock",
      "id": "fullText2",
      "isVisible": false,
      "text": "Experts from leading tech companies will share real-world implementations and personalization strategies that adapt content, interfaces, and services to individual user profiles — along with the ethical considerations that come with them.",
      "wrap": true,
      "size": "Small",
      "spacing": "None"
    },
    {
      "type": "RichTextBlock",
      "id": "showMore",
      "spacing": "ExtraSmall",
      "inlines": [
        {
          "type": "TextRun",
          "text": "Show more",
          "color": "Accent",
          "selectAction": {
            "type": "Action.ToggleVisibility",
            "targetElements": [
              "truncatedText",
              "fullText1",
              "fullText2",
              "showMore",
              "showLess"
            ]
          }
        }
      ]
    },
    {
      "type": "RichTextBlock",
      "id": "showLess",
      "isVisible": false,
      "spacing": "ExtraSmall",
      "inlines": [
        {
          "type": "TextRun",
          "text": "Show less",
          "color": "Accent",
          "selectAction": {
            "type": "Action.ToggleVisibility",
            "targetElements": [
              "truncatedText",
              "fullText1",
              "fullText2",
              "showMore",
              "showLess"
            ]
          }
        }
      ]
    },
    {
      "type": "ActionSet",
      "spacing": "Medium",
      "actions": [
        {
          "type": "Action.ShowCard",
          "title": "Reserve a seat",
          "style": "positive",
          "card": {
            "type": "AdaptiveCard",
            "version": "1.5",
            "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
            "body": [
              {
                "type": "Input.Text",
                "id": "name",
                "placeholder": "Enter your full name",
                "label": "Name",
                "isRequired": true,
                "errorMessage": "A name is required"
              },
              {
                "type": "Input.Text",
                "id": "email",
                "placeholder": "Enter your email address",
                "label": "Email address",
                "isRequired": true,
                "errorMessage": "An email is required"
              },
              {
                "type": "ActionSet",
                "actions": [
                  {
                    "type": "Action.Submit",
                    "title": "Submit",
                    "style": "positive"
                  }
                ]
              }
            ]
          }
        }
      ]
    }
  ]
}
```
