ArcadiaDragGrid

A CSS Grid-based drag-and-drop layout component. Renders ArcadiaDragGridItem children in a responsive grid with drag reordering and resize support.

Basic Usage

<ArcadiaDragGrid Columns="4" RowHeight="120" Gap="16"
                 EditMode="true" AllowResize="true"
                 OnReorder="HandleReorder">
    <ArcadiaDragGridItem Id="panel-1" ColSpan="2" RowSpan="1">
        <HeaderContent>Sales</HeaderContent>
        <ChildContent>
            <p>Panel content here</p>
        </ChildContent>
    </ArcadiaDragGridItem>
</ArcadiaDragGrid>

Parameters

ParameterTypeDefaultDescription
ChildContentRenderFragment?Child content (should contain ArcadiaDragGridItem components)
Columnsint4Number of columns in the grid
RowHeightint120Height of each row in pixels
Gapint16Gap between grid items in pixels
LayoutDragGridLayout?Current layout state for two-way binding
LayoutChangedEventCallback<DragGridLayout>Callback when layout changes due to drag or resize
EditModebooltrueWhether drag and resize are enabled
DragModestring"direct""direct" (drag from handle) or "longpress" (iOS-style wiggle mode)
LongPressDurationint500Milliseconds before long-press activates wiggle mode
AllowResizebooltrueWhether items can be resized
DragScaleUpdouble1.03Scale factor applied to items while being dragged
SpringStiffnessint170Spring stiffness for drag animations
SpringDampingint26Spring damping for drag animations
AutoSaveboolfalseAuto-save layout to localStorage on every drop/resize
ShowAddButtonboolfalseShow an “Add Panel” button above the grid
AllowRemoveboolfalseShow remove (“x”) button on each panel

Events

EventTypeDescription
LayoutChangedEventCallback<DragGridLayout>Fired when layout changes
OnReorderEventCallback<DragGridReorderEventArgs>Fired when an item is reordered via drag
OnItemResizedEventCallback<DragGridResizeEventArgs>Fired when an item is resized
OnAddPanelEventCallbackFired when the “Add Panel” button is clicked
OnRemovePanelEventCallback<string>Fired when a panel’s remove button is clicked (receives panel ID)

Drag Modes

Direct Mode (default)

Drag immediately from the panel’s drag handle:

<ArcadiaDragGrid DragMode="direct" ... />

Long-Press / Wiggle Mode

iOS-style: long-press any card to enter wiggle mode, then drag to reorder. Tap “Done” to exit:

<ArcadiaDragGrid DragMode="longpress" LongPressDuration="500" ... />

State Persistence

Auto-Save

<ArcadiaDragGrid AutoSave="true" ... />

Manual Save/Load

@code {
    ArcadiaDragGrid? grid;

    async Task Save() => await grid!.SaveLayoutAsync("my-dashboard");
    async Task Load() => await grid!.LoadLayoutAsync("my-dashboard");
}

Keyboard Navigation

When EditMode is enabled:

KeyAction
Enter / SpacePick up or drop the focused panel
Arrow keysMove the picked-up panel (left/right by 1, up/down by column count)
EscapeCancel the current move

Live ARIA announcements keep screen reader users informed of panel positions during keyboard drag operations.

Accessibility

  • role="grid" on the container
  • aria-label announcements for drag start, move, and drop
  • Keyboard-only drag-and-drop with full screen reader support
  • Respects prefers-reduced-motion for drag animations