Example of Horizontal Card in ASP.NET MVC Card Control
This sample demonstrates card rendering with horizontal layout. Based on the horizontal structure, product card is shown with detailed information.
iPhone X
Marketed by Apple Inc
The iPhone X has a 5.8-inch diagonal OLED color-accurate screen, has two cameras on the rear. One is a 12-megapixel with support for face detection. It is capable of capturing 4K video at 24, 30 or 60 frames per second. It supports Qi-standard wireless charging.

Philips Trimmer
Philips trimmers are designed to last longer than 4 ordinary trimmers and DuraPower Technology which optimizes power.


Canon 135mm
The fastest 135mm telephoto lens in its class. Two UD-glass elements correct secondary spectrum for outstanding sharpness and color.
@Html.UiCard(new UiCardOptions
{
Id = "horizontal_phone_product", Horizontal = true, Title = "iPhone X", SubTitle = "Marketed by Apple Inc", ImageUrl = Url.Content("~/Content/card/iphone.png"), ImageTitle = "iPhone X",
Content = "The iPhone X has a 5.8-inch diagonal OLED color-accurate screen, has two cameras on the rear. One is a 12-megapixel with support for face detection. It is capable of capturing 4K video at 24, 30 or 60 frames per second. It supports Qi-standard wireless charging.",
Actions = { new UiCardAction { Text = "64GB" }, new UiCardAction { Text = "256GB" } }
})
@Html.UiCard(new UiCardOptions
{
Id = "horizontal_product", Horizontal = true, Title = "Philips Trimmer", ImageUrl = Url.Content("~/Content/card/Trimmer.png"), ImageTitle = "Trimmer",
Content = "Philips trimmers are designed to last longer than 4 ordinary trimmers and DuraPower Technology which optimizes power."
})
@Html.UiCard(new UiCardOptions
{
Id = "horizontal_camera", Horizontal = true, ImageFirst = true, Title = "Canon 135mm", ImageUrl = Url.Content("~/Content/card/Camera.png"), ImageTitle = "Camera",
Content = "The fastest 135mm telephoto lens in its class. Two UD-glass elements correct secondary spectrum for outstanding sharpness and color."
})
<style>
.card-layout { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; max-width: 900px; margin: 0 auto; padding: 20px 0; }
.card-layout > * { flex: 0 1 380px; min-width: 260px; }
.card-layout .ui-card { width: 100%; box-sizing: border-box; }
.card-layout .ui-card + .ui-card { margin-top: 20px; }
.card-layout p { margin: 0; }
</style>
<div class="control-section card-control-section horizontal_card_layout">
<div class="card-layout">
<div>
@Html.UiCard(new UiCardOptions
{
Id = "horizontal_phone_product", Horizontal = true, Title = "iPhone X", SubTitle = "Marketed by Apple Inc", ImageUrl = Url.Content("~/Content/card/iphone.png"), ImageTitle = "iPhone X",
Content = "The iPhone X has a 5.8-inch diagonal OLED color-accurate screen, has two cameras on the rear. One is a 12-megapixel with support for face detection. It is capable of capturing 4K video at 24, 30 or 60 frames per second. It supports Qi-standard wireless charging.",
Actions = { new UiCardAction { Text = "64GB" }, new UiCardAction { Text = "256GB" } }
})
</div>
<div id="vertical_Sample">
@Html.UiCard(new UiCardOptions
{
Id = "horizontal_product", Horizontal = true, Title = "Philips Trimmer", ImageUrl = Url.Content("~/Content/card/Trimmer.png"), ImageTitle = "Trimmer",
Content = "Philips trimmers are designed to last longer than 4 ordinary trimmers and DuraPower Technology which optimizes power."
})
@Html.UiCard(new UiCardOptions
{
Id = "horizontal_camera", Horizontal = true, ImageFirst = true, Title = "Canon 135mm", ImageUrl = Url.Content("~/Content/card/Camera.png"), ImageTitle = "Camera",
Content = "The fastest 135mm telephoto lens in its class. Two UD-glass elements correct secondary spectrum for outstanding sharpness and color."
})
</div>
</div>
</div>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class CardController : Controller
{
// The page is Views/Card/HorizontalCard.cshtml; it draws what ViewData holds.
public ActionResult HorizontalCard()
{
return View();
}
}
}
@* Install once: Install-Package Lumen.UI.Mvc (or: dotnet add package Lumen.UI.Mvc) *@
@* Views/Web.config: <add namespace="Lumen.UI.Mvc" /> *@
@* Views/Shared/_Layout.cshtml *@
<head>
@Html.UiStyles()
<link rel="stylesheet" href="~/Content/site.css" />
</head>
<body>
@RenderBody()
@Html.UiScripts()
@RenderSection("scripts", required: false)
</body>
By default, card elements are stacked one after another vertically. You can customize the card with specific direction by adding e-card-horizontal to align elements horizontally. Using e-card-stacked class, you can split the horizontal layout with a stacked element on left or right of the card.