Labsco
microsoft logo

add-dock-band

✓ Official136,050

by microsoft · part of microsoft/powertoys

Add dock band support to your Command Palette extension for persistent toolbar widgets. Use when asked to add dock support, toolbar buttons, persistent UI widgets, taskbar integration, live-updating status displays, quick-access buttons, or always-visible controls. Supports single buttons, multi-button strips, and live-updating content.

🧰 Not standalone. This skill ships with microsoft/powertoys and only works together with that tool — install the tool first, then add this skill.

This is the playbook your agent receives when the skill activates — you don't need to read it to use the skill, but it's here to audit before installing.

Add Dock Band Support

The Command Palette Dock is a persistent toolbar at the edge of the user's screen. Your extension can provide dock bands — strips of items that appear in the Dock — giving users quick access to commands without opening the full Command Palette.

When to Use This Skill

  • Adding a quick-access button to the persistent toolbar
  • Creating a multi-button toolbar strip
  • Displaying live-updating information (clock, CPU usage, etc.)
  • Providing frequently-used commands without opening the full palette

Multi-Button Dock Band

Use WrappedDockItem to create a band with multiple buttons:

public override ICommandItem[]? GetDockBands()
{
    var button1 = new ListItem(new OpenUrlCommand("https://github.com"))
    {
        Title = "GitHub",
        Icon = new IconInfo("\uE774"),
    };
    var button2 = new ListItem(new OpenUrlCommand("https://learn.microsoft.com"))
    {
        Title = "Learn",
        Icon = new IconInfo("\uE82D"),
    };

    var band = new WrappedDockItem(
        [button1, button2],
        "com.mycompany.myextension.quicklinks", // Unique band ID
        "Quick Links");

    return [band];
}

How Dock Bands Render

Command Type on ICommandItemDock Behavior
IInvokableCommandSingle button that executes the command
IListPageEach list item renders as a separate button in one band
IContentPageSingle expandable button with a flyout

Support Pinning Nested Commands

By default, only top-level commands and dock bands can be pinned. To allow pinning nested commands:

public override ICommandItem? GetCommandItem(string id)
{
    // Look up commands by their Id
    foreach (var item in GetAllCommands())
    {
        if (item?.Command is ICommand cmd && cmd.Id == id)
            return item;
    }
    return null;
}

Important Notes

  • All dock band ICommandItem objects must have a Command with a non-empty Id — items without an ID are ignored
  • Set Id on your CommandProvider (e.g., Id = "com.mycompany.myextension")
  • Use WrappedDockItem for multi-button bands backed by a ListPage
  • Keep dock band updates lightweight — they run frequently

Documentation