Klevr Product Documentation logo

Dynamics List 2.0 Custom Cards

This article explains how to customize Dynamics List 2.0 cards using custom CSS.

Feature Overview

This article explains how to customize Dynamics List 2.0 cards using custom CSS. The Dynamics List 2.0 – Custom Cards enhancement enables flexible and configurable card-based UI rendering by leveraging dynamic HTML templates along with CSS class prefixing for styling.

Objective

The primary objectives of this enhancement are to:

  • Enable custom card layouts driven by configurable HTML templates
  • Support dynamic placeholder replacement of the fetchxml result data.
  • Allow CSS customization through configurable CSS class prefixes

Key Enhancements Implemented

  • Introduced a Rich Text Editor for customCardHtml, allowing users to define custom card layout content dynamically.
  • HTML templates can include placeholders (for example, {klevr_name}, {klevr_code}), which are replaced at runtime using the corresponding values from the list item data.
  • The customCardHtml configuration is applied only when the “Render As Cards” option is enabled and the Rich Text Editor is not empty, ensuring backward compatibility.

Key Enhancements Implemented (1)

Key Enhancements Implemented (1)
  • Added support for a Custom Card CSS Prefix field:
    • This prefix is used to dynamically apply CSS class names to card elements.
    • A corresponding custom CSS file can be uploaded using this prefix to style the cards as required.
    • The custom CSS file must be uploaded via the Umbraco Backoffice → Home page.

Key Enhancements Implemented (2)

Key Enhancements Implemented (2)

· Sample CSS (Custom CSS Prefix: ex : custom-menu)

  • · Below is a sample set of CSS classes that can be included in the uploaded custom CSS file when the Custom Card CSS Prefix is set to custom-menu:
/*
=================================================================================
   CUSTOM CARD MENU STYLES and Syntax / Naming Convention:
   --------------------------------------------------------
   .  All CSS class names must start with the configured prefix.
   .  The prefix is configured dynamically in the Umbraco backoffice via the `Custom Card CSS Prefix` field (e.g., `custom-menu`).
  .  The prefix helps scope styles and avoid conflicts with existing layouts.
  .  Class naming pattern: <prefix>-<element>
  .  Example:
        .custom-menu-root
        .custom-menu-card-outer
=================================================================================
*/
/* Root container for the custom menu
   - Acts as the top-level wrapper */
.custom-menu-root {
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    padding: 24px;
}

/* Grid container that holds all cards
   - Groups multiple cards into a single layout*/
.custom-menu-grid-layout {
    background-color: rgba(255, 255, 255, 0.6);
    padding: 16px;
    border-radius: 16px;
}

/* Outer container for an individual card
   - Defines the card boundary */
.custom-menu-card-outer {
    background: linear-gradient(180deg, #ffffff, #f9fafb);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Interaction state for the card
   - Enhances feedback when the user hovers over a card */
.custom-menu-card-outer:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
}

/* Inner wrapper within the card
   - Used to arrange card content vertically*/
.custom-menu-card-wrapper {
    background-color: #eef4ff;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Content container inside the card
   - Holds dynamic or static card content */
.custom-menu-card-inner {
    border-radius: 10px;
    padding: 14px;
}

/* Action button within the card
   - Represents the primary user action
   - Positioned at the bottom of the card layout */
.custom-menu-card-button {
    margin-top: auto;
    border-radius: 24px;
    padding: 6px 18px;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

Key Enhancements Implemented (3)

Key Enhancements Implemented (3)

Dependencies

The following are dependencies for this feature:

Last updated on