Skip to content

Commit 147dfd4

Browse files
authored
Update for the GA of Top Actions (SharePoint#8848)
1 parent 252fb98 commit 147dfd4

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

docs/spfx/web-parts/guidance/getting-started-with-top-actions.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ ms.localizationpriority: high
1111

1212
Today, users need to be aware of the web part property panels to find out the additional options each web part provides. This is a common piece of feedback where users want actions surfacing in context of where they are without having to rely on opening something to get to those options. Therefore, we are now allowing to surface most common configurations from a web part's property panel directly on to the web part's toolbar. These common configurations are referred to as the web part's Top Actions.
1313

14-
> [!IMPORTANT]
15-
> This feature is still preview status as part of the 1.16 release and should not be used in production. We are looking into releasing them officially as part of the upcoming 1.17 release.At the time of writing this article, Top Actions only supports rendering a drop-down and button command.
16-
1714
![Top Actions Example](../../../images/webpart-top-actions.png)
1815

1916
## Getting started
@@ -86,16 +83,16 @@ return {
8683
The type interace for a button is similar to the property panel's button (`IPropertyPaneButtonProps`).
8784

8885
```typescript
89-
import { ITopActions } from '@microsoft/sp-top-actions';
90-
import { PropertyPaneFieldType } from '@microsoft/sp-property-pane';
86+
import { ITopActions, TopActionsFieldType } from '@microsoft/sp-top-actions';
9187
...
9288
public getTopActionsConfiguration(): ITopActions | undefined {
9389
return {
9490
topActions: [
9591
{
9692
targetProperty: 'reset',
97-
type: PropertyPaneFieldType.Button,
93+
type: TopActionsFieldType.Button,
9894
properties: {
95+
text: 'Reset',
9996
icon: 'Reset'
10097
}
10198
}
@@ -115,14 +112,13 @@ public getTopActionsConfiguration(): ITopActions | undefined {
115112
The type interface for a drop-down is similar to the property panel's choice group (`IPropertyPaneChoiceGroupOption`).
116113

117114
```typescript
118-
import { ITopActions } from '@microsoft/sp-top-actions';
119-
import { PropertyPaneFieldType } from '@microsoft/sp-property-pane';
115+
import { ITopActions, TopActionsFieldType } from '@microsoft/sp-top-actions';
120116
...
121117
public getTopActionsConfiguration(): ITopActions | undefined {
122118
return {
123119
topActions: [{
124120
targetProperty: 'layout',
125-
type: PropertyPaneFieldType.ChoiceGroup,
121+
type: TopActionsFieldType.ChoiceGroup,
126122
properties: {
127123
options: [
128124
{
@@ -157,18 +153,13 @@ public getTopActionsConfiguration(): ITopActions | undefined {
157153

158154
## Advanced configurations
159155

160-
For advanced configurations of your top action commands, checkout the type definitions from `@microsoft/sp-property-pane` and `@microsoft/sp-top-actions`. Currently, the two supported top action commands, button and drop-down, can be defined using a subset of the types `IPropertyPaneChoiceGroupOption` and `IPropertyPaneButtonProps`.
156+
For advanced configurations of your top action commands, checkout the type definitions from `@microsoft/sp-top-actions`.
161157

162-
* For `IPropertyPaneButtonProps`, the currently supported properties are `icon`, `text`, `ariaLabel`, `disabled`
163-
* For `IPropertyPaneChoiceGroupOption`, the currently supported porperty is `options` and from that array we support `key`, `text`, `iconProps.officeFabricIconFontName`, `imageSize`, `checked`, `title`
164158

165159
```typescript
166-
import { IPropertyPaneButtonProps, IPropertyPaneChoiceGroupOption } from '@microsoft/sp-property-pane'
167-
import { ITopActions } from '@microsoft/sp-top-actions';
160+
import { ITopActions, ITopActionsButtonProps, ITopActionsDropdownProps } from '@microsoft/sp-top-actions';
168161
```
169162

170163
### See more
171164

172165
[Top Actions API](/javascript/api/sp-top-actions)
173-
[IPropertyPaneButtonProps](/javascript/api/sp-webpart-base/ipropertypanebuttonprops)
174-
[IPropertyPaneChoiceGroupOption](/javascript/api/sp-webpart-base/ipropertypanechoicegroupoption)

0 commit comments

Comments
 (0)