Example of Default Functionalities in ASP.NET MVC Skeleton Control
This sample demonstrates the different shapes supported by the skeleton component. The Skeleton is an animating placeholder which shows the expected layout before the actual content is loaded.
Circle
Square
Text
Rectangle
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonCircle0", Shape = UiSkeletonShape.Circle, Width = "1.875rem" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonCircle1", Shape = UiSkeletonShape.Circle, Width = "48px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonCircle2", Shape = UiSkeletonShape.Circle, Width = "64px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonCircle3", Shape = UiSkeletonShape.Circle, Width = "80px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonSquare0", Shape = UiSkeletonShape.Square, Width = "1.875rem" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonSquare1", Shape = UiSkeletonShape.Square, Width = "48px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonSquare2", Shape = UiSkeletonShape.Square, Width = "64px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonSquare3", Shape = UiSkeletonShape.Square, Width = "80px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonText", Shape = UiSkeletonShape.Text, Width = "100%", Height = "15px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonTextMedium", Shape = UiSkeletonShape.Text, Width = "30%", Height = "15px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonTextSmall", Shape = UiSkeletonShape.Text, Width = "15%", Height = "15px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonTextMedium1", Shape = UiSkeletonShape.Text, Width = "60%", Height = "15px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonTextSmall1", Shape = UiSkeletonShape.Text, Width = "15%", Height = "15px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonRectangle", Shape = UiSkeletonShape.Rectangle, Width = "100%", Height = "100px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonRectangleMedium", Shape = UiSkeletonShape.Rectangle, Width = "120px", Height = "35px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonRectangleMediumRight", Shape = UiSkeletonShape.Rectangle, Width = "120px", Height = "35px" })
<style>
.skeleton-default, .skeleton-animation { display: flex; flex-wrap: wrap; gap: 24px; padding: 12px 20px; }
.skeleton-default > div, .skeleton-animation > div { flex: 1 1 320px; min-width: 0; padding: 12px; position: relative; }
.skeleton-default h5, .skeleton-animation h5 { margin: 0 0 12px; font-size: 14px; }
.skeleton-default .ui-skeleton { display: inline-block; margin: 0 8px 8px 0; }
.sk-card { display: block; padding: 14px; border: 1px solid var(--ui-border); border-radius: 8px; background: var(--ui-surface); }
.sk-card .row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sk-avatar { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #7c3aed, #0f6cbd); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sk-image { height: 250px; border-radius: 6px; background: linear-gradient(135deg, #bbdefb, #c8e6c9); margin-bottom: 12px; }
.sk-actions { display: flex; justify-content: space-between; }
.sk-list { list-style: none; margin: 0; padding: 0; }
.sk-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ui-border); }
.sk-dot { width: 40px; height: 40px; border-radius: 50%; background: #9ca3af; flex: none; }
.sk-list .lines { flex: 1; min-width: 0; }
</style>
<div class="control-section">
<div class="skeleton-default">
<div>
<h5>Circle</h5>
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonCircle0", Shape = UiSkeletonShape.Circle, Width = "1.875rem" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonCircle1", Shape = UiSkeletonShape.Circle, Width = "48px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonCircle2", Shape = UiSkeletonShape.Circle, Width = "64px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonCircle3", Shape = UiSkeletonShape.Circle, Width = "80px" })
</div>
<div>
<h5>Square</h5>
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonSquare0", Shape = UiSkeletonShape.Square, Width = "1.875rem" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonSquare1", Shape = UiSkeletonShape.Square, Width = "48px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonSquare2", Shape = UiSkeletonShape.Square, Width = "64px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonSquare3", Shape = UiSkeletonShape.Square, Width = "80px" })
</div>
</div>
<div class="skeleton-default">
<div>
<h5>Text</h5>
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonText", Shape = UiSkeletonShape.Text, Width = "100%", Height = "15px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonTextMedium", Shape = UiSkeletonShape.Text, Width = "30%", Height = "15px" })<br />
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonTextSmall", Shape = UiSkeletonShape.Text, Width = "15%", Height = "15px" })<br />
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonTextMedium1", Shape = UiSkeletonShape.Text, Width = "60%", Height = "15px" })<br />
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonTextSmall1", Shape = UiSkeletonShape.Text, Width = "15%", Height = "15px" })
</div>
<div>
<h5>Rectangle</h5>
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonRectangle", Shape = UiSkeletonShape.Rectangle, Width = "100%", Height = "100px" })
<div style="display: flex; justify-content: space-between">
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonRectangleMedium", Shape = UiSkeletonShape.Rectangle, Width = "120px", Height = "35px" })
@Html.UiSkeleton(new UiSkeletonOptions { Id = "skeletonRectangleMediumRight", Shape = UiSkeletonShape.Rectangle, Width = "120px", Height = "35px" })
</div>
</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 SkeletonController : Controller
{
// The page is Views/Skeleton/DefaultFunctionalities.cshtml; it draws what ViewData holds.
public ActionResult DefaultFunctionalities()
{
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>
The shape of skeleton can be changed using the Shape property. It supports Circle, Square, Text and Rectangle. By default, the wave animation effect is applied.