Data Table

Customize

Enterprise data table and card gallery with dual view modes, configurable columns, context menus, status pills, priority badges, segmented progress bars, and full theme customization. Supports up to 8 dynamic columns with auto/fixed/percentage widths.

data-table.yaml

Import via Components → New component → Import from code

Preview

Actions
Case ID
Title
Status
Progress
Assignee
Due Date
Priority
C-2026-001
VNS Upgrade Project
Technical
In Progress
Phase 2/4
Rodas Yonass
2026-01-15
High
C-2026-002
Budget Review Q1
Finance
In Progress
Phase 3/5
Sarah Johnson
2026-01-12
High
C-2025-098
Crime Scene Tech Training
Training
Completed
Phase 5/5
Mike Chen
2026-01-05
Medium
C-2026-003
Policy Update Review
Policy
Not Started
Phase 1/3
Emily Davis
2026-01-20
Low
C-2025-095
Hate Crime Stats Report
Analytics
In Progress
Phase 2/4
Alex Martinez
2026-01-18
Medium

Installation

Copy the YAML component definition and import into Power Apps Studio.

# In Power Apps Studio:
1. Components → New component → Import from code
2. Paste YAML definition
3. Component appears in library
4. Configure Items, Columns, and theme properties

Usage

Basic implementation

// Set data source
cmpDynamicGallery.Items: YourDataSource
cmpDynamicGallery.Width: Parent.Width
cmpDynamicGallery.Height: 600

// Define columns (supports up to 8)
cmpDynamicGallery.Columns: Table(
    {Field: "Actions", Header: "Actions", Align: "Center",
     Mode: "px", WidthPx: 50, AutoMinPx: 50, AutoMaxPx: 50},
    {Field: "CaseID", Header: "Case ID", Align: "Left",
     Mode: "px", WidthPx: 120, AutoMinPx: 100, AutoMaxPx: 150},
    {Field: "Title", Header: "Title", Align: "Left",
     Mode: "auto", WidthPx: 280, AutoMinPx: 220, AutoMaxPx: 360},
    {Field: "Status", Header: "Status", Align: "Center",
     Mode: "px", WidthPx: 120, AutoMinPx: 100, AutoMaxPx: 140}
)

View mode toggle

// Enable view toggle between table and card
cmpDynamicGallery.ShowViewToggle: true
cmpDynamicGallery.ViewMode: "table"  // Default: "table" or "card"

// React to view changes
cmpDynamicGallery.OnViewChange:
    Notify(
        "Switched to " & cmpDynamicGallery.SelectedViewMode & " view",
        NotificationType.Information
    )

// Read current view
Set(varCurrentView, cmpDynamicGallery.SelectedViewMode)

Context menu with SVG icons

// Enable context menu
cmpDynamicGallery.EnableMenu: true

// Define menu items with SVG icons
cmpDynamicGallery.ContextMenuItems: Table(
    {
        ItemKey: "view",
        ItemDisplayName: "View",
        ItemIconSvg: "<svg ...>...</svg>",
        ItemIconColor: "60,60,60,1",
        ItemEnabled: true,
        ItemVisible: true
    },
    {
        ItemKey: "edit",
        ItemDisplayName: "Edit",
        ItemIconSvg: "<svg ...>...</svg>",
        ItemIconColor: "60,60,60,1",
        ItemEnabled: true,
        ItemVisible: true
    },
    {
        ItemKey: "delete",
        ItemDisplayName: "Delete",
        ItemIconSvg: "<svg ...>...</svg>",
        ItemIconColor: "248,113,113,1",
        ItemEnabled: true,
        ItemVisible: true
    }
)

// Handle menu selection
cmpDynamicGallery.OnMenuItemSelect:
    Switch(
        cmpDynamicGallery.SelectedMenuItem.ItemKey,
        "view", Navigate(ViewScreen, None, {Item: cmpDynamicGallery.SelectedItem}),
        "edit", Navigate(EditScreen, None, {Item: cmpDynamicGallery.SelectedItem}),
        "delete", Remove(DataSource, cmpDynamicGallery.SelectedItem)
    )

Status & priority configuration

// Status pills (5 built-in statuses + default)
cmpDynamicGallery.StatusField: "Status"
cmpDynamicGallery.StatusConfig: {
    pill: {radius: 20, paddingX: 16, paddingY: 6, fontSize: 11, fontWeight: "Semibold"},
    inProgress: {background: "219,234,254,1", text: "30,64,175,1"},
    completed: {background: "212,244,221,1", text: "15,81,50,1"},
    onHold: {background: "254,243,199,1", text: "146,64,14,1"},
    notStarted: {background: "243,244,246,1", text: "75,85,99,1"},
    default: {background: "240,240,240,1", text: "96,96,96,1"}
}

// Priority badges (3 levels + default)
cmpDynamicGallery.PriorityConfig: {
    high: {background: "254,226,226,1", text: "185,28,28,1"},
    medium: {background: "254,243,199,1", text: "146,64,14,1"},
    low: {background: "220,252,231,1", text: "22,101,52,1"},
    default: {background: "243,244,246,1", text: "75,85,99,1"}
}

Progress bar colors

// Segmented progress bar (SVG-based, up to 10 segments)
// Uses CompletedSteps and TotalSteps from your data
cmpDynamicGallery.ProgressActiveColor: "2563EB"    // Blue hex without #
cmpDynamicGallery.ProgressInactiveColor: "E2E8F0"  // Gray hex without #

// Your data should include:
// CompletedSteps: 3, TotalSteps: 5

Theme customization

cmpDynamicGallery.ThemeConfig: {
    container: {
        background: "255,255,255,1",
        border: "224,224,224,1",
        borderThickness: 1,
        radius: 12
    },
    header: {
        background: "249,250,251,1",
        border: "224,224,224,1",
        borderThickness: 2,
        textColor: "96,96,96,1",
        fontSize: 11,
        fontWeight: "Semibold",
        height: 50
    },
    row: {
        background: "0,0,0,0",
        hoverBackground: "248,249,250,0.5",
        borderColor: "240,240,240,1",
        borderThickness: 1,
        height: 60
    },
    card: {
        background: "255,255,255,1",
        border: "229,231,235,1",
        borderThickness: 1,
        radius: 12,
        height: 280,
        gap: 16
    },
    text: {
        primary: "32,32,32,1",
        secondary: "96,96,96,1",
        accent: "37,99,235,1",
        fontFamily: "Segoe UI",
        fontSizeNormal: 12,
        fontSizeSmall: 11,
        fontWeightNormal: "Normal",
        fontWeightBold: "Semibold"
    },
    spacing: {
        paddingLeft: 20,
        paddingTop: 16,
        columnGap: 10
    }
}

Properties

Input Properties

PropertyTypeDefaultDescription
ItemsTableSample dataData source for the gallery. Must include fields matching column definitions.
ColumnsTable8-column layoutColumn definitions with Field, Header, Align, Mode, WidthPx, AutoMinPx, AutoMaxPx.
ViewModeText"table"Initial view mode: "table" or "card".
ShowViewToggleBooleantrueShow the table/card view toggle buttons.
ShowHeaderBooleantrueShow column headers in table view.
EnableMenuBooleantrueEnable context menu (⋮) button on rows.
EnableHoverBooleantrueEnable row hover highlight effects.
ContextMenuItemsTableView, Edit, DeleteMenu items with ItemKey, ItemDisplayName, ItemIconSvg, ItemIconColor, ItemEnabled, ItemVisible.
MenuConfigRecordDefault stylingContext menu visual config: icon size/color, container bg/border/radius, item colors/heights.
StatusFieldText"Status"Which data field maps to status pills.
StatusConfigRecord5 statusesColors for: inProgress, completed, onHold, notStarted, default. Includes pill styling.
PriorityConfigRecord3 prioritiesColors for: high, medium, low, default priority badges.
ProgressActiveColorText"2563EB"Hex color (without #) for completed progress segments.
ProgressInactiveColorText"E2E8F0"Hex color (without #) for incomplete progress segments.
ThemeConfigRecordLight themeFull theme: container, header, row, card, text, and spacing configuration.

Output Properties

PropertyTypeDescription
SelectedItemRecordCurrently selected row/card data record.
SelectedMenuItemRecordThe last selected context menu item (ItemKey, ItemDisplayName, etc.).
SelectedViewModeTextCurrent active view mode ("table" or "card").
ColContextRecordComputed column layout: Cols table, TotalWidth, Gap, PadL.

Events

EventDescription
OnRowSelectFires when a row or card is tapped. SelectedItem is populated before this fires.
OnMenuItemSelectFires when a context menu item is chosen. SelectedMenuItem and SelectedItem both populated.
OnViewChangeFires when the user toggles between table and card views.

Implementation

Column system

Supports up to 8 columns with three width modes: px (fixed width),auto (flexible between AutoMinPx and AutoMaxPx). Each column definition includes Field, Header, Align (Left/Center/Right), Mode, WidthPx, AutoMinPx, and AutoMaxPx. The computed ColContext output provides total width for horizontal scroll.

Dual view modes

Table view renders rows in a horizontal auto-layout gallery with configurable header. Card view renders responsive cards using WrapCount (1 column under 600px, 2 under 1024px, 3 above). Both views share the same data source and support context menus.

Context menus

Built with the TabList modern control for reliable flyout behavior. Menu items support custom SVG icons, RGBA color strings, and individual enabled/visible flags. The delete action uses a distinct red color (ItemIconColor: "248,113,113,1").

Progress bars

Segmented SVG progress bars render dynamically based on CompletedSteps and TotalSteps fields. Supports up to 10 segments. Colors are customizable via ProgressActiveColor and ProgressInactiveColor (hex without #). Both table rows and cards render identical progress visuals.

Color system

All colors use RGBA string format ("R,G,B,A") parsed at runtime with Split() and Value(). This enables full customization through input properties without modifying the component internals.

Row selection

Table rows use an invisible button overlay for tap detection. The overlay starts after the actions column to prevent interfering with the context menu. On select, varDG_SelectedItem and varDG_MenuRowItem are both set, then OnRowSelect fires.

Examples

Theme:☀️ Light

Context menu actions

OnMenuItemSelect:
  Switch(
    Self.SelectedMenuItem.ItemKey,
    "view", 
      Navigate(DetailScreen, None, {
        Record: Self.SelectedItem
      }),
    "edit", 
      Set(varEditMode, true);
      Set(varEditRecord, Self.SelectedItem),
    "delete",
      Remove(DataSource, Self.SelectedItem)
  )

Status pills & priority badges

Status

In ProgressCompletedOn HoldNot Started

Priority

HighMediumLow

Progress

Phase 3/5
// Built-in status matching
// Uses Lower() + Switch() pattern
Switch(
  Lower(Text(ThisItem.Status)),
  "in progress", InProgressColors,
  "completed", CompletedColors,
  "on hold", OnHoldColors,
  "not started", NotStartedColors,
  DefaultColors
)

// Priority uses same pattern
Switch(
  Lower(Text(ThisItem.Priority)),
  "high", HighColors,
  "medium", MediumColors,
  "low", LowColors,
  DefaultColors
)

// Progress reads from data fields:
// ThisItem.CompletedSteps
// ThisItem.TotalSteps

Full 8-column definition

Columns: Table(
  {Field: "Actions",  Header: "Actions",  Align: "Center", Mode: "px",   WidthPx: 50,  AutoMinPx: 50,  AutoMaxPx: 50},
  {Field: "CaseID",   Header: "Case ID",  Align: "Left",   Mode: "px",   WidthPx: 120, AutoMinPx: 100, AutoMaxPx: 150},
  {Field: "Title",    Header: "Title",    Align: "Left",   Mode: "auto", WidthPx: 280, AutoMinPx: 220, AutoMaxPx: 360},
  {Field: "Status",   Header: "Status",   Align: "Center", Mode: "px",   WidthPx: 120, AutoMinPx: 100, AutoMaxPx: 140},
  {Field: "Progress", Header: "Progress", Align: "Left",   Mode: "px",   WidthPx: 180, AutoMinPx: 150, AutoMaxPx: 200},
  {Field: "Assignee", Header: "Assignee", Align: "Left",   Mode: "auto", WidthPx: 150, AutoMinPx: 120, AutoMaxPx: 180},
  {Field: "DueDate",  Header: "Due Date", Align: "Left",   Mode: "px",   WidthPx: 120, AutoMinPx: 100, AutoMaxPx: 140},
  {Field: "Priority", Header: "Priority", Align: "Center", Mode: "px",   WidthPx: 100, AutoMinPx: 80,  AutoMaxPx: 120}
)
// ColContext output will compute TotalWidth for scroll container