-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BlockSwitcher: Add README and JS doc for BlockSwitcher component
- Loading branch information
1 parent
a2b6d39
commit 9784d4a
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
packages/block-editor/src/components/block-switcher/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Block Switcher | ||
|
||
The `BlockSwitcher` component provides a toolbar dropdown menu for converting between block types, applying block styles, and accessing pattern transformations. It appears in the block toolbar when these transformation options are available. | ||
|
||
## Usage | ||
|
||
Render component to enable block transformations. | ||
|
||
```jsx | ||
import { BlockSwitcher } from '@wordpress/block-editor'; | ||
|
||
function MyBlockSwitcher() { | ||
return ( | ||
<BlockSwitcher clientIds={['ch1d82m9-d33a-4c12-b5d9-a8927e12b654']} /> | ||
); | ||
} | ||
``` | ||
|
||
## Props | ||
|
||
### clientIds | ||
|
||
The client IDs of the blocks that will be displayed in the block list. | ||
|
||
- Type: `Array<String>` | ||
- Required: Yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters