File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
docs/documentation/docs/controls Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,11 @@ import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder";
16
16
- Use the ` Placeholder ` control in your code as follows:
17
17
18
18
``` TypeScript
19
- < Placeholder
20
- iconName = ' Edit'
21
- iconText = ' Configure your web part'
22
- description = ' Please configure the web part.'
23
- buttonLabel = ' Configure'
24
- onConfigure = {this._onConfigure } / >
19
+ < Placeholder iconName = ' Edit'
20
+ iconText = ' Configure your web part'
21
+ description = ' Please configure the web part.'
22
+ buttonLabel = ' Configure'
23
+ onConfigure = {this._onConfigure } / >
25
24
```
26
25
27
26
- With the ` onConfigure ` property you can define what it needs to do when you click on the button. Like for example opening the property pane:
@@ -33,6 +32,17 @@ private _onConfigure() {
33
32
}
34
33
```
35
34
35
+ Sample of using the ` hideButton ` functionality for hiding the button when page is in read mode:
36
+
37
+ ``` TypeScript
38
+ < Placeholder iconName = ' Edit'
39
+ iconText = ' Configure your web part'
40
+ description = ' Please configure the web part.'
41
+ buttonLabel = ' Configure'
42
+ hideButton = {this.props.displayMode === DisplayMode .Read }
43
+ onConfigure = {this._onConfigure } / >
44
+ ```
45
+
36
46
## Implementation
37
47
38
48
The placeholder control can be configured with the following properties:
You can’t perform that action at this time.
0 commit comments