Modern Theme

« Extensions

The Modern theme provides a clean, framework-agnostic look with card-style container, refined headers, hover states, and self-contained pager and search styling. No Bootstrap table classes required.

Full Example

Apply the theme, then configure sorting, paging, search, and columns as needed:

Clear
Name▲▼ Movie Director▲▼ Genre▲▼ Released▲▼
2001: A Space Odyssey Stanley Kubrick Sci-Fi 1968
Airplane! David and Jerry Zucker and Jim Abrahams Slapstick 1980
Brave Heart Mel Gibson Action
Casablanca Michael Curtiz Drama 1942
Citizen Kane Orson Welles Drama 1941

@(await Html
    .SimpleGrid(Model)
    .Theme(GridTheme.Modern)
    .Sortable()
    .DefaultSortBy(m => m.Name)
    .AddColumn(col => col.For(m => m.Name).Sortable())
    .AddColumn(col => col.For(m => m.Director).Sortable())
    .AddColumn(col => col
        .Header("Genre")
        .DisplayAs(m => $"<span class='sh-badge sh-badge-info'>{WebUtility.HtmlEncode(m.Genre)}</span>")
        .Encoded(false)
        .SortableBy(m => m.Genre))
    .AddColumnFor(m => m.Released)
    .AddSearch("Name", ...)
    .AddSearch("Director", ...)
    .AddPager(options => { ... })
    .RenderAsync())

Row Modifiers

Highlight rows based on conditions:

Name▲▼ Movie Director▲▼ Movie Genre▲▼ Released▲▼
2001: A Space Odyssey Stanley Kubrick Sci-Fi 1968
Airplane! David and Jerry Zucker and Jim Abrahams Slapstick 1980
Brave Heart Mel Gibson Action
Casablanca Michael Curtiz Drama 1942
Citizen Kane Orson Welles Drama 1941

@(await Html
    .SimpleGrid(Model)
    .Theme(GridTheme.Modern)
    .AddColumnsForModel()
    .Sortable()
    .DefaultSortBy(m => m.Name)
    .AddRowModifier(
        m => m.Released.HasValue && m.Released.Value < 1980,
        css => css.AddClass("sh-row-warning"))
    .RenderAsync())

Side by Side: Classic vs Modern

Classic (default)
Name Movie Director Movie Genre Released
Star Wars George Lucas Sci-Fi 1997
Reservoir Dogs Quentin Tarantino Thriller 1992
Airplane! David and Jerry Zucker and Jim Abrahams Slapstick 1980
Terminator James Cameron Action 1984
Terminator 2: Judgement Day James Cameron Action 1991
Modern Theme
Name▲▼ Movie Director▲▼ Movie Genre▲▼ Released▲▼
Star Wars George Lucas Sci-Fi 1997
Reservoir Dogs Quentin Tarantino Thriller 1992
Airplane! David and Jerry Zucker and Jim Abrahams Slapstick 1980
Terminator James Cameron Action 1984
Terminator 2: Judgement Day James Cameron Action 1991

CSS Classes Available

Class Usage Preview
sh-badge sh-badge-success Green badge Active
sh-badge sh-badge-warning Yellow badge Pending
sh-badge sh-badge-danger Red badge Disabled
sh-badge sh-badge-info Blue badge Info
sh-row-warning Yellow row highlight (use with AddRowModifier)