Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Add block patterns list component readme #24983

Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7cda590
Start block patterns list component readme
JustinyAhin Sep 1, 2020
956d2a5
Update block patterns list component readme
JustinyAhin Sep 1, 2020
ffad813
Update block patterns list component readme
JustinyAhin Sep 2, 2020
0de8001
Add block patterns list component props
JustinyAhin Sep 4, 2020
7d7be13
Update block patterns list component readme
JustinyAhin Sep 7, 2020
e3653cb
Update JSX code sample
JustinyAhin Sep 7, 2020
f0709ea
Update component readme props
JustinyAhin Sep 7, 2020
7590f9d
Update component props description
JustinyAhin Sep 7, 2020
42b757d
Update component readme props description
JustinyAhin Sep 7, 2020
8efb740
Update component props types
JustinyAhin Sep 10, 2020
edc5e27
Start block patterns list component readme
JustinyAhin Sep 1, 2020
e4e17e0
Update block patterns list component readme
JustinyAhin Sep 1, 2020
18b9055
Update block patterns list component readme
JustinyAhin Sep 2, 2020
66ab238
Add block patterns list component props
JustinyAhin Sep 4, 2020
c2d89c5
Update block patterns list component readme
JustinyAhin Sep 7, 2020
aad5eeb
Update JSX code sample
JustinyAhin Sep 7, 2020
a9f8cc7
Update component readme props
JustinyAhin Sep 7, 2020
2eed765
Update component props description
JustinyAhin Sep 7, 2020
fe19607
Update component readme props description
JustinyAhin Sep 7, 2020
76892d9
Update component props types
JustinyAhin Sep 10, 2020
dafe938
Merge branch 'add/block-patterns-list-component-readme' of https://gi…
JustinyAhin Nov 26, 2020
bd73a7f
Update the component props description
JustinyAhin Nov 26, 2020
f0561c6
Merge remote-tracking branch 'upstream/master' into add/block-pattern…
JustinyAhin Nov 26, 2020
5b5966e
Update packages/block-editor/src/components/block-patterns-list/READM…
gziolo Nov 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions packages/block-editor/src/components/block-patterns-list/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Block Patterns List

The `BlockPatternList` component makes a list of the different registered block patterns. It uses the `BlockPreview` component to display a preview for each block pattern.

For more infos about blocks patterns, read [this](https://make.wordpress.org/core/2020/07/16/block-patterns-in-wordpress-5-5/).

![Block patterns sidebar in WordPress 5.5](https://make.wordpress.org/core/files/2020/09/blocks-patterns-sidebar-in-wordpress-5-5.png)

## Table of contents

1. [Development guidelines](#development-guidelines)
2. [Related components](#related-components)

## Development guidelines

### Usage

Renders a block patterns list.

```jsx
import { BlockPatternList } from '@wordpress/block-editor';

const MyBlockPatternList = () => (
<BlockPatternList
blockPatterns={ shownBlockPatterns }
shownPatterns={ shownBlockPatterns }
onClickPattern={ onSelectBlockPattern }
/>
);
```

### Props

#### blockPatterns

An array of block patterns that can be shown in the block patterns list.

- Type: `Array`
- Required: Yes

#### shownPatterns

An array of shown block patterns objects.


- Type: `Array`
- Required: Yes

#### onClickPattern

The performed event after a click on a block pattern. In most cases, the pattern is inserted in the block editor.

- Type: `Function`
- Required: Yes

## Related components

Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree.