QuickGrid Examples

Leverage the Microsoft's QuickGrid Blazor componet and achieve Flowbite styling by applying the flowbite-grid CSS class and the Theme="flowbite".

<div class="grid flowbite-grid">
    <QuickGrid Theme="flowbite">
</div>

Basic Grid #

A simple grid showing Pokemon data with basic columns.

#
Name
Type
HP
Attack
Defense
1BulbasaurGrass454949
2IvysaurGrass606263
3VenusaurGrass808283
4CharmanderFire395243
5CharmeleonFire586458
6CharizardFire788478
7SquirtleWater444865
8WartortleWater596380
9BlastoiseWater7983100
25PikachuElectric355540
143SnorlaxNormal16011065
149DragoniteDragon9113495
150MewtwoPsychic10611090
151MewPsychic100100100
<div class="grid flowbite-grid text-xs">
    <QuickGrid Items="@_pokemon" Theme="flowbite">
        <PropertyColumn Property="@(p => p.Id)" Title="#" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Name)" Title="Name" />
        <PropertyColumn Property="@(p => p.Type1)" Title="Type" />
        <PropertyColumn Property="@(p => p.HP)" Title="HP" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Attack)" Title="Attack" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Defense)" Title="Defense" Align="Align.Center" />
    </QuickGrid>
</div>

Sorting and Filtering #

Grid with sortable columns and name filtering capability.

1BulbasaurGrass454949
2IvysaurGrass606263
3VenusaurGrass808283
4CharmanderFire395243
5CharmeleonFire586458
6CharizardFire788478
7SquirtleWater444865
8WartortleWater596380
9BlastoiseWater7983100
25PikachuElectric355540
143SnorlaxNormal16011065
149DragoniteDragon9113495
150MewtwoPsychic10611090
151MewPsychic100100100
<div class="grid flowbite-grid text-xs">
    <QuickGrid Items="@FilteredPokemon" Theme="flowbite">
        <PropertyColumn Property="@(p => p.Id)" Title="#" Sortable="true" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Name)" Title="Name" Sortable="true">
            <ColumnOptions>
                <div class="search-box">
                    <input type="search" autofocus @bind="_nameFilter" @bind:event="oninput" placeholder="Search..." />
                </div>
            </ColumnOptions>
        </PropertyColumn>
        <PropertyColumn Property="@(p => p.Type1)" Title="Type" Sortable="true" />
        <PropertyColumn Property="@(p => p.HP)" Title="HP" Sortable="true" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Attack)" Title="Attack" Sortable="true" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Defense)" Title="Defense" Sortable="true" Align="Align.Center" />
    </QuickGrid>
</div>

Template Columns #

Custom column templates for enhanced visualization of Pokemon types and stats.

#
Name
Types
Stats
1Bulbasaur
GrassPoison
HP: 45
Attack: 49
2Ivysaur
GrassPoison
HP: 60
Attack: 62
3Venusaur
GrassPoison
HP: 80
Attack: 82
4Charmander
Fire
HP: 39
Attack: 52
5Charmeleon
Fire
HP: 58
Attack: 64
6Charizard
FireFlying
HP: 78
Attack: 84
7Squirtle
Water
HP: 44
Attack: 48
8Wartortle
Water
HP: 59
Attack: 63
9Blastoise
Water
HP: 79
Attack: 83
25Pikachu
Electric
HP: 35
Attack: 55
143Snorlax
Normal
HP: 160
Attack: 110
149Dragonite
DragonFlying
HP: 91
Attack: 134
150Mewtwo
Psychic
HP: 106
Attack: 110
151Mew
Psychic
HP: 100
Attack: 100
<div class="grid flowbite-grid text-xs">
    <QuickGrid Items="@_pokemon" Theme="flowbite">
        <PropertyColumn Property="@(p => p.Id)" Title="#" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Name)" Title="Name" />
        <TemplateColumn Title="Types">
            <div class="flex gap-2">
                <span class="@GetTypeClass(context.Type1)">@context.Type1</span>
                @if (!string.IsNullOrEmpty(context.Type2))
                {
                    <span class="@GetTypeClass(context.Type2)">@context.Type2</span>
                }
            </div>
        </TemplateColumn>
        <TemplateColumn Title="Stats">
            <div class="flex flex-col gap-1">
                <div class="flex items-center gap-2">
                    <span class="w-16 text-sm">HP: @context.HP</span>
                    <div class="w-32 bg-gray-200 rounded-full h-2">
                        <div class="bg-green-600 h-2 rounded-full" style="width: @(context.HP * 100 / 255)%"></div>
                    </div>
                </div>
                <div class="flex items-center gap-2">
                    <span class="w-16 text-sm">Attack: @context.Attack</span>
                    <div class="w-32 bg-gray-200 rounded-full h-2">
                        <div class="bg-red-600 h-2 rounded-full" style="width: @(context.Attack * 100 / 255)%"></div>
                    </div>
                </div>
            </div>
        </TemplateColumn>
    </QuickGrid>
</div>

Paging #

Grid with pagination support and page size selection.

1BulbasaurGrass454949
2IvysaurGrass606263
3VenusaurGrass808283
4CharmanderFire395243
5CharmeleonFire586458
14 items
<div class="grid flowbite-grid text-xs">
    <QuickGrid Theme="flowbite" Items="@_pokemon" Pagination="@_pagination">
        <PropertyColumn Property="@(p => p.Id)" Title="#" Sortable="true" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Name)" Title="Name" Sortable="true" />
        <PropertyColumn Property="@(p => p.Type1)" Title="Type" Sortable="true" />
        <PropertyColumn Property="@(p => p.HP)" Title="HP" Sortable="true" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Attack)" Title="Attack" Sortable="true" Align="Align.Center" />
        <PropertyColumn Property="@(p => p.Defense)" Title="Defense" Sortable="true" Align="Align.Center" />
    </QuickGrid>
    <Paginator State="@_pagination" />
</div>
An unhandled error has occurred. Reload 🗙