# Custom Cards

## Overview

<figure><img src="/files/eft9WocWlxhGQFzpH0rr" alt=""><figcaption></figcaption></figure>

## Usage

### When to use this component?

Custom cards are perfect when you need flexibility in both design and content. Use them when standard card layouts don't meet your requirements, and you want to tailor the structure, style, and interaction to suit specific data types, user needs, or branding guidelines. Ideal for dashboards, content feeds, or modular UI sections, custom cards empower designers and developers to create rich, personalized components.

### How it works

Custom cards act as a configurable container that supports dynamic content and layout customization. Users can define their own combinations of elements—such as headings, icons, buttons, media, and metadata—and control styling aspects like spacing, colors, and typography. This modular approach enables the creation of reusable components while allowing full creative freedom to adapt to various use cases. Optional slots or configuration props can be used to inject custom content or interactivity, making the cards highly versatile across projects.

### Code

{% tabs %}
{% tab title="Vanilla Js" %}

```jsx
<dda-custom-card
    card_header_text="Card Custom Title"
    card_header_icon="more_horiz"
    card_header_icon_id="cartHeaderdotts"
    custom_class="custom-card"
    component_mode=""
>
    <img src="https://lipsum.app/id/12/1800x800" class="dda-card-img dda-rounded-md" alt="card image"/>
    <h5 class="h5 Regular" aria-label="Card title">Card main title</h5>
    <p class="dda-card-text dda-d-flex dda-align-items-start dda-gap-2" aria-label="Card description">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    </p>
    <div class="dda-row">
        <div class="dda-col-6">
            <dda-button
                button_type="button"
                button_color="default-primary"
                start_icon=""
                button_text="Cancel"
                end_icon=""
                button_id="default-primary-btn"
                aria_label="default primary button"
                button_name="defaultPrimaryButton"
                value="default-primary-value"
                button_shape="default"
                size="md"
                gap="1"
                disabled="false"
                custom_class="dda-w-100"
                component_mode=""
                onclick="console.log('native click')"
            ></dda-button>
        </div>
        <div class="dda-col-6">
            <dda-button
                button_type="button"
                button_color="default-primary"
                start_icon=""
                button_text="Submit"
                end_icon=""
                button_id="default-primary-btn"
                aria_label="default primary button"
                button_name="defaultPrimaryButton"
                value="default-primary-value"
                button_shape="default"
                size="md"
                gap="1"
                disabled="false"
                custom_class="dda-w-100"
                component_mode=""
                onclick="console.log('native click')"
            ></dda-button>
        </div>
    </div>
</dda-custom-card>
```

{% endtab %}

{% tab title="React" %}

```jsx
<DdaCustomCard
    card_header_text="Card Custom Title"
    card_header_icon="more_horiz"
    card_header_icon_id="cartHeaderdotts"
    custom_class="custom-card"
    component_mode=""
>
    <img src="https://lipsum.app/id/12/1800x800" class="dda-card-img dda-rounded-md" alt="card image"/>
    <h5 class="h5 Regular" aria-label="Card title">Card main title</h5>
    <p class="dda-card-text dda-d-flex dda-align-items-start dda-gap-2" aria-label="Card description">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    </p>
    <div class="dda-row">
        <div class="dda-col-6">
            <dda-button
                button_type="button"
                button_color="default-primary"
                start_icon=""
                button_text="Cancel"
                end_icon=""
                button_id="default-primary-btn"
                aria_label="default primary button"
                button_name="defaultPrimaryButton"
                value="default-primary-value"
                button_shape="default"
                size="md"
                gap="1"
                disabled="false"
                custom_class="dda-w-100"
                component_mode=""
                onclick="console.log('native click')"
            ></dda-button>
        </div>
        <div class="dda-col-6">
            <dda-button
                button_type="button"
                button_color="default-primary"
                start_icon=""
                button_text="Submit"
                end_icon=""
                button_id="default-primary-btn"
                aria_label="default primary button"
                button_name="defaultPrimaryButton"
                value="default-primary-value"
                button_shape="default"
                size="md"
                gap="1"
                disabled="false"
                custom_class="dda-w-100"
                component_mode=""
                onclick="console.log('native click')"
            ></dda-button>
        </div>
    </div>
</DdaCustomCard>
```

{% endtab %}

{% tab title="Vue" %}

```jsx
<DdaCustomCard
    card_header_text="Card Custom Title"
    card_header_icon="more_horiz"
    card_header_icon_id="cartHeaderdotts"
    custom_class="custom-card"
    component_mode=""
>
    <img src="https://lipsum.app/id/12/1800x800" class="dda-card-img dda-rounded-md" alt="card image"/>
    <h5 class="h5 Regular" aria-label="Card title">Card main title</h5>
    <p class="dda-card-text dda-d-flex dda-align-items-start dda-gap-2" aria-label="Card description">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    </p>
    <div class="dda-row">
        <div class="dda-col-6">
            <dda-button
                button_type="button"
                button_color="default-primary"
                start_icon=""
                button_text="Cancel"
                end_icon=""
                button_id="default-primary-btn"
                aria_label="default primary button"
                button_name="defaultPrimaryButton"
                value="default-primary-value"
                button_shape="default"
                size="md"
                gap="1"
                disabled="false"
                custom_class="dda-w-100"
                component_mode=""
                onclick="console.log('native click')"
            ></dda-button>
        </div>
        <div class="dda-col-6">
            <dda-button
                button_type="button"
                button_color="default-primary"
                start_icon=""
                button_text="Submit"
                end_icon=""
                button_id="default-primary-btn"
                aria_label="default primary button"
                button_name="defaultPrimaryButton"
                value="default-primary-value"
                button_shape="default"
                size="md"
                gap="1"
                disabled="false"
                custom_class="dda-w-100"
                component_mode=""
                onclick="console.log('native click')"
            ></dda-button>
        </div>
    </div>
</DdaCustomCard>
```

{% endtab %}

{% tab title="Angular" %}

```jsx
<dda-custom-card
    card_header_text="Card Custom Title"
    card_header_icon="more_horiz"
    card_header_icon_id="cartHeaderdotts"
    custom_class="custom-card"
    component_mode=""
>
    <img src="https://lipsum.app/id/12/1800x800" class="dda-card-img dda-rounded-md" alt="card image"/>
    <h5 class="h5 Regular" aria-label="Card title">Card main title</h5>
    <p class="dda-card-text dda-d-flex dda-align-items-start dda-gap-2" aria-label="Card description">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    </p>
    <div class="dda-row">
        <div class="dda-col-6">
            <dda-button
                button_type="button"
                button_color="default-primary"
                start_icon=""
                button_text="Cancel"
                end_icon=""
                button_id="default-primary-btn"
                aria_label="default primary button"
                button_name="defaultPrimaryButton"
                value="default-primary-value"
                button_shape="default"
                size="md"
                gap="1"
                disabled="false"
                custom_class="dda-w-100"
                component_mode=""
                onclick="console.log('native click')"
            ></dda-button>
        </div>
        <div class="dda-col-6">
            <dda-button
                button_type="button"
                button_color="default-primary"
                start_icon=""
                button_text="Submit"
                end_icon=""
                button_id="default-primary-btn"
                aria_label="default primary button"
                button_name="defaultPrimaryButton"
                value="default-primary-value"
                button_shape="default"
                size="md"
                gap="1"
                disabled="false"
                custom_class="dda-w-100"
                component_mode=""
                onclick="console.log('native click')"
            ></dda-button>
        </div>
    </div>
</dda-custom-card>
```

{% endtab %}
{% endtabs %}

### Properties

| Property               | Description                                                                                                                        | Type     |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -------- |
| card\_header\_text     | The label displayed at the top of the banner card, typically indicating the card’s category or context (e.g., "Event").            | `string` |
| card\_header\_icon     | Name of the Icon to be shown alongside the header text.                                                                            | `string` |
| card\_header\_icon\_id | Unique identifier for the header icon element. Useful for targeting the icon programmatically (e.g., for click events or testing). | `string` |

## Anatomy

<figure><img src="/files/yMdPNYVayqYdPrSWM9ue" alt=""><figcaption></figcaption></figure>

### Anatomy Options

**Card Title:** Indicates the type of content (e.g., “Event”), helping users immediately recognize the card’s purpose.

**Icon:** **con:** A contextual icon that can represent various functions such as settings, alerts, status indicators, or additional options—serving as a quick access point for supporting actions or information relevant to the event card.

**Image:** A banner image representing the event, used for visual context and thematic consistency.

**Event Title:** The primary title of the event, clearly stating its name or subject.

**Description:** A short text summary providing users with a quick overview of the event’s focus or content.

**Button:** A clear call-to-action that guides users to view more detailed event information.

***

## Dos and Don'ts

| Dos                                                                                          | Don'ts                                                                                   |
| -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| **Use clear, legible icons** that immediately convey the card's purpose or action.           | **Don’t use low-quality or blurry images** for the `image_src`—it reduces visual appeal. |
| **Write concise, meaningful titles** to ensure quick understanding.                          | **Avoid long or vague titles** that don’t communicate the card’s content.                |
| **Keep descriptions short and relevant** to avoid overwhelming users.                        | **Don’t overload the description** with too much text—keep it scannable.                 |
| **Use consistent styling and spacing** if multiple cards are displayed together.             | **Avoid placing multiple cards without spacing**, which can cause visual clutter.        |
| Maintain a consistent design language across all cards to ensure a cohesive user experience. | **Don’t leave the `onclick` empty or use console logs in production.**                   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://designsystem.dubai.ae/components/cards/custom-cards.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
