Skip to content

Commit 2d0a537

Browse files
committed
Changes
1 parent ca86c48 commit 2d0a537

7 files changed

Lines changed: 398 additions & 6 deletions

File tree

hub/powertoys/always-on-top.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Always On Top has the following settings:
2929
| :--- | :--- |
3030
| **Activation shortcut** | The customizable keyboard command to turn on or off the always-on-top property for that window. |
3131
| **Do not activate when Game Mode is on** | Prevents the feature from being activated when actively playing a game on the system. |
32+
| **Show Always on Top in the title bar context menu** | Lets you turn Always on Top mode on or off from the window's title bar right-click menu. |
3233
| **Show a border around the pinned window** | When **On**, this option shows a colored border around the pinned window. |
3334
| **Color mode** | Choose either **Windows default** or **Custom color** for the highlight border. |
3435
| **Color** | The custom color of the highlight border. **Color** is only available when **Color mode** is set to **Custom color**. |
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
title: Adding Dock support to your extension
3+
description: Learn how to add Dock support to your Command Palette extension, allowing users to pin your commands to the persistent Dock toolbar.
4+
ms.date: 03/09/2026
5+
ms.topic: how-to
6+
no-loc: [PowerToys, Windows, Insider]
7+
# Customer intent: As a Windows developer, I want to learn how to add Dock support to my Command Palette extension.
8+
---
9+
10+
# Adding Dock support to your extension
11+
12+
**Previous**: [Get user input with forms](using-form-pages.md)
13+
14+
The Command Palette [Dock](dock.md) is a persistent toolbar that stays visible at the edge of the user's screen. Extensions can provide **dock bands** — strips of items that appear in the Dock — to give users quick access to frequently used commands without opening the full Command Palette.
15+
16+
> [!IMPORTANT]
17+
> Dock support requires **Command Palette Extension SDK version 0.9 or later**. Make sure your extension project references `Microsoft.CommandPalette.Extensions` version 0.9.260303001 or higher.
18+
19+
## Overview
20+
21+
Dock support is provided through two interfaces:
22+
23+
- **`ICommandProvider3`** — Adds the `GetDockBands()` method, which lets your extension provide dock bands.
24+
- **`ICommandProvider4`** — Adds the `GetCommandItem(string id)` method, which enables pinning of nested commands to the Dock.
25+
26+
If you're using the `CommandProvider` base class from the toolkit, you can simply override these methods.
27+
28+
## Add dock bands to your extension
29+
30+
To provide dock bands, override the `GetDockBands()` method in your `CommandProvider` subclass. Each `ICommandItem` returned from this method is treated as one atomic band in the Dock.
31+
32+
Here's a simple example that exposes a single command as a dock band:
33+
34+
```csharp
35+
using Microsoft.CommandPalette.Extensions;
36+
using Microsoft.CommandPalette.Extensions.Toolkit;
37+
38+
namespace <ExtensionName>;
39+
40+
public partial class <ExtensionName>CommandsProvider : CommandProvider
41+
{
42+
private readonly ICommandItem[] _commands;
43+
private readonly ICommandItem _dockBand;
44+
45+
public <ExtensionName>CommandsProvider()
46+
{
47+
DisplayName = "My Extension";
48+
Id = "com.mycompany.myextension";
49+
50+
var mainPage = new <ExtensionName>Page();
51+
_dockBand = new CommandItem(mainPage) { Title = DisplayName };
52+
_commands = [new CommandItem(mainPage) { Title = DisplayName }];
53+
}
54+
55+
public override ICommandItem[] TopLevelCommands() => _commands;
56+
57+
public override ICommandItem[]? GetDockBands()
58+
{
59+
return [_dockBand];
60+
}
61+
}
62+
```
63+
64+
When the user enables the Dock and adds your extension's band, it appears as a button in the Dock toolbar.
65+
66+
## Create multi-button bands with WrappedDockItem
67+
68+
If you want your dock band to display multiple buttons in a single strip, use the `WrappedDockItem` helper class. This lets you pass in an array of `IListItem` objects, and they're rendered as individual buttons within one band.
69+
70+
```csharp
71+
using Microsoft.CommandPalette.Extensions;
72+
using Microsoft.CommandPalette.Extensions.Toolkit;
73+
74+
namespace <ExtensionName>;
75+
76+
public partial class <ExtensionName>CommandsProvider : CommandProvider
77+
{
78+
public <ExtensionName>CommandsProvider()
79+
{
80+
DisplayName = "My Extension";
81+
Id = "com.mycompany.myextension";
82+
}
83+
84+
public override ICommandItem[] TopLevelCommands() => [];
85+
86+
public override ICommandItem[]? GetDockBands()
87+
{
88+
var button1 = new ListItem(new OpenUrlCommand("https://github.com"))
89+
{
90+
Title = "GitHub"
91+
};
92+
var button2 = new ListItem(new OpenUrlCommand("https://learn.microsoft.com"))
93+
{
94+
Title = "Microsoft Learn"
95+
};
96+
97+
var band = new WrappedDockItem(
98+
[button1, button2],
99+
"com.mycompany.myextension.quicklinks",
100+
"Quick Links");
101+
102+
return [band];
103+
}
104+
}
105+
```
106+
107+
The `WrappedDockItem` class creates a band backed by a `ListPage` that holds your items. Each item in the array is rendered as a separate button in the Dock.
108+
109+
> [!TIP]
110+
> You can also create a `WrappedDockItem` from a single `ICommand` by using the `WrappedDockItem(ICommand command, string displayTitle)` constructor.
111+
112+
## How dock bands work
113+
114+
Each `ICommandItem` returned from `GetDockBands()` represents one atomic band. How the band is rendered depends on the `Command` property of the `ICommandItem`:
115+
116+
| Command type | Dock behavior |
117+
| :--- | :--- |
118+
| `IInvokableCommand` | Renders as a single button that executes the command when selected. |
119+
| `IListPage` | Renders all items on the page as individual buttons in one band. |
120+
| `IContentPage` | Renders as a single expandable button with a flyout. |
121+
122+
> [!NOTE]
123+
> All `ICommandItem` objects returned from `GetDockBands()` must have a `Command` with a non-empty `Id`. Items without an ID are ignored.
124+
125+
## Support pinning with GetCommandItem
126+
127+
By default, users can only pin top-level commands and dock bands to the Dock. If you want users to be able to pin **nested commands** (commands that are deeper inside your extension), override the `GetCommandItem(string id)` method:
128+
129+
```csharp
130+
public override ICommandItem? GetCommandItem(string id)
131+
{
132+
var allCommands = GetAllAvailableItems();
133+
foreach (var item in allCommands)
134+
{
135+
if (item?.Command is ICommand cmd && cmd.Id == id)
136+
{
137+
return item;
138+
}
139+
}
140+
141+
return null;
142+
}
143+
```
144+
145+
This method is called by the Command Palette when it needs to resolve a pinned command by its ID. If your extension doesn't override this method, only commands returned from `GetDockBands()` and `TopLevelCommands()` can be pinned.
146+
147+
## Real-world example
148+
149+
Here's how the built-in Time & Date extension provides a dock band that shows a live clock:
150+
151+
```csharp
152+
public override ICommandItem[] GetDockBands()
153+
{
154+
var bandItem = new NowDockBand();
155+
var wrappedBand = new WrappedDockItem(
156+
[bandItem],
157+
"com.microsoft.cmdpal.timedate.dockBand",
158+
"Time & Date");
159+
160+
return [wrappedBand];
161+
}
162+
```
163+
164+
The `NowDockBand` is a `ListItem` that updates its `Title` and `Subtitle` every minute to show the current time and date. This demonstrates how dock bands can display dynamic, live-updating content.
165+
166+
## Related content
167+
168+
- [Command Palette Dock](dock.md)
169+
- [Extensibility overview](extensibility-overview.md)
170+
- [Extension samples](samples.md)
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: PowerToys Command Palette Dock
3+
description: Learn how to use the Command Palette Dock, a persistent toolbar that provides quick access to your most-used commands and extensions from any screen edge.
4+
ms.date: 03/09/2026
5+
ms.topic: concept-article
6+
no-loc: [PowerToys, Windows, Insider]
7+
# Customer intent: Learn about the Command Palette Dock feature and how to configure it.
8+
---
9+
10+
# Command Palette Dock
11+
12+
The Command Palette Dock is a persistent toolbar that stays visible at the edge of your screen, providing instant access to your most-used commands and extensions without needing to open the full Command Palette window.
13+
14+
> [!NOTE]
15+
> The Dock feature is part of the Command Palette and requires Command Palette to be enabled and running in the background.
16+
17+
## Enable the Dock
18+
19+
To enable the Dock, open Command Palette settings and toggle the **Enable Dock** option. When enabled, the Dock appears as a toolbar anchored to the edge of your screen.
20+
21+
## Dock layout
22+
23+
The Dock is divided into three regions that organize your pinned commands:
24+
25+
| Region | Position | Description |
26+
| :--- | :--- | :--- |
27+
| **Start** | Left side (or top, for vertical docks) | Primary commands and launchers. By default, includes the Home command and WinGet launcher. |
28+
| **Center** | Middle | Additional commands you add. Initially empty. |
29+
| **End** | Right side (or bottom, for vertical docks) | Utility widgets. By default, includes Performance Monitor and Date/Time widgets. |
30+
31+
The Dock displays horizontally when anchored to the top or bottom of the screen, and vertically when anchored to the left or right.
32+
33+
## Pin commands to the Dock
34+
35+
There are several ways to pin commands and extensions to the Dock.
36+
37+
### Pin from Command Palette
38+
39+
The easiest way to add a command to the Dock is directly from the Command Palette:
40+
41+
1. Open the Command Palette and navigate to the command you want to pin.
42+
2. Right-click the command and select **Pin to Dock**, or open the **More actions** menu and select **Pin to Dock**.
43+
44+
To remove a pinned command, right-click it and select **Unpin from Dock**.
45+
46+
### Pin from Dock edit mode
47+
48+
You can also manage the Dock layout by entering edit mode:
49+
50+
1. Right-click the Dock background and select **Edit Dock**.
51+
2. Select the **+** button in the Start, Center, or End region to add a new command.
52+
3. Choose from the list of available commands in the flyout.
53+
4. Drag and drop commands to reorder them within or across regions.
54+
5. Select **Save** to apply your changes, or **Discard** to revert.
55+
56+
You can right-click individual items in edit mode to toggle **Show Titles** and **Show Subtitles**, or to **Unpin** a command from the Dock.
57+
58+
### Pin from Dock settings
59+
60+
In the Command Palette settings, the **Bands** section lists all available dock bands. Use the toggle switch next to each band to pin or unpin it from the Dock.
61+
62+
## Dock settings
63+
64+
The following settings are available for the Dock in Command Palette settings.
65+
66+
| Setting | Description |
67+
| :--- | :--- |
68+
| Enable Dock | Enable a toolbar with quick access to commands. |
69+
70+
### Appearance
71+
72+
| Setting | Description |
73+
| :--- | :--- |
74+
| Position | Choose which screen edge to anchor the Dock to: **Left**, **Top** (default), **Right**, or **Bottom**. |
75+
| Theme mode | Select which theme to display: **Use system settings** (default), **Light**, or **Dark**. |
76+
| Material | Select the visual material: **Transparent** or **Acrylic** (default). |
77+
| Background colorization | Customize the Dock background. Options include **None**, **Accent color** (uses the Windows system accent color), **Custom color** (pick a color tint and intensity), or **Image** (set a background image with brightness, blur, and fit controls). |
78+
79+
When **Image** is selected as the background colorization mode, the following additional settings are available:
80+
81+
| Setting | Description |
82+
| :--- | :--- |
83+
| Background image | Browse for an image file (supports PNG, BMP, JPG, GIF, TIFF, WEBP, and other common formats). |
84+
| Background image brightness | Adjust the brightness of the background image (–100 to 100). |
85+
| Background image blur | Set the blur effect applied to the background image (0–50). |
86+
| Background image fit | Choose how the background image is scaled: **Fill** or **Stretch**. |
87+
88+
When **Custom color** or **Image** is selected, you can also configure:
89+
90+
| Setting | Description |
91+
| :--- | :--- |
92+
| Color tint | Pick a custom color tint for the Dock background. |
93+
| Color intensity | Adjust the intensity of the color tint (1–100). |
94+
95+
### Bands
96+
97+
The **Bands** section lists all available dock bands provided by installed extensions. Each band has a toggle switch to pin or unpin it from the Dock.
98+
99+
## Dock behavior
100+
101+
The Dock uses the Windows AppBar API to reserve screen space, so other windows don't overlap it. The Dock:
102+
103+
- Stays visible at all times while enabled (auto-hide is not currently supported).
104+
- Automatically restores its position if Windows Explorer restarts.
105+
- Cannot be resized or dragged — its position is controlled by the **Position** setting.
106+
107+
## Related content
108+
109+
- [Command Palette overview](overview.md)
110+
- [Extensibility overview](extensibility-overview.md)

hub/powertoys/command-palette/extensibility-overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ For more detailed instructions, you can follow these pages:
2222
* [Command results](../command-palette/command-results.md)
2323
* [Display markdown content](../command-palette/using-markdown-content.md)
2424
* [Get user input with forms](../command-palette/using-form-pages.md)
25+
* [Adding Dock support](../command-palette/adding-dock-support.md)
2526
<!-- * [Handle the search text](../command-palette/dynamic-lists.md) -->
2627
<!-- * [Advanced: Adding an extension to your package](../command-palette/adding-an-extension-to-your-package.md) -->
2728

0 commit comments

Comments
 (0)