Transfer List

MokaTransferList<TItem> renders two side-by-side lists with controls to move items between them. It supports custom item templates, optional search filtering, and configurable list titles.

Parameters

Name Type Default Description
AvailableItems IReadOnlyList<TItem> [] Items shown in the left (available) list
SelectedItems IReadOnlyList<TItem> [] Items shown in the right (selected) list
SelectedItemsChanged EventCallback<IReadOnlyList<TItem>> -- Callback when the selected items change
ItemTemplate RenderFragment<TItem>? -- Custom template for rendering each item
AvailableTitle string "Available" Header text for the left list
SelectedTitle string "Selected" Header text for the right list
Searchable bool false Shows search inputs above each list
OnTransfer EventCallback<IReadOnlyList<TItem>> -- Callback after items are transferred
Class string? -- Additional CSS classes
Style string? -- Additional inline styles

Basic String List

<MokaTransferList TItem="string"
                  AvailableItems="available"
                  @bind-SelectedItems="selected" />

@code {
    IReadOnlyList<string> available = new[] { "Alpha", "Bravo", "Charlie", "Delta", "Echo" };
    IReadOnlyList<string> selected = Array.Empty<string>();
}
[CS1503] /Preview.razor(2,35): Argument 1: cannot convert from 'System.Collections.Generic.IReadOnlyList<string>' to 'System.Collections.Generic.IList<string>' [CS1503] /Preview.razor(3,40): Argument 1: cannot convert from 'System.Collections.Generic.IReadOnlyList<string>' to 'System.Collections.Generic.IList<string>'

Custom Item Template

Use ItemTemplate to customize how each item is rendered in both lists.

<MokaTransferList TItem="string"
                  AvailableItems="langs"
                  @bind-SelectedItems="chosenLangs"
                  AvailableTitle="Languages"
                  SelectedTitle="My Stack">
    <ItemTemplate>
        <MokaFlexbox Align="MokaAlign.Center" Gap="MokaSpacingScale.Xs">
            <MokaIcon Icon="MokaIcons.File.Code" Size="MokaSize.Sm" />
            <MokaText>@context</MokaText>
        </MokaFlexbox>
    </ItemTemplate>
</MokaTransferList>

@code {
    IReadOnlyList<string> langs = new[] { "C#", "TypeScript", "Python", "Rust", "Go" };
    IReadOnlyList<string> chosenLangs = Array.Empty<string>();
}
[CS1503] /Preview.razor(2,35): Argument 1: cannot convert from 'System.Collections.Generic.IReadOnlyList<string>' to 'System.Collections.Generic.IList<string>' [CS1503] /Preview.razor(3,40): Argument 1: cannot convert from 'System.Collections.Generic.IReadOnlyList<string>' to 'System.Collections.Generic.IList<string>'

Searchable

Enable Searchable to let users filter items in both lists.

<MokaTransferList TItem="string"
                  AvailableItems="cities"
                  @bind-SelectedItems="visitedCities"
                  AvailableTitle="All Cities"
                  SelectedTitle="Visited"
                  Searchable="true" />

@code {
    IReadOnlyList<string> cities = new[] { "Tokyo", "London", "New York", "Paris", "Sydney", "Berlin", "Toronto" };
    IReadOnlyList<string> visitedCities = Array.Empty<string>();
}
[CS1503] /Preview.razor(2,35): Argument 1: cannot convert from 'System.Collections.Generic.IReadOnlyList<string>' to 'System.Collections.Generic.IList<string>' [CS1503] /Preview.razor(3,40): Argument 1: cannot convert from 'System.Collections.Generic.IReadOnlyList<string>' to 'System.Collections.Generic.IList<string>'
Last updated: 2026-04-11
Was this page helpful?