-
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.
`content` is no longer a property as the content of the notice is defined by the children of the component. From https://wordpress.slack.com/archives/C02QB2JS7/p1525848612000302
- Loading branch information
1 parent
823dcf2
commit 3e65bd2
Showing
1 changed file
with
23 additions
and
3 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,10 +1,30 @@ | ||
This component is used to implement notices in editor. | ||
Notice | ||
====== | ||
|
||
#### Props | ||
This component is used to display notices in editor. | ||
|
||
## Usage | ||
|
||
To display a plain notice, pass `Notice` a string: | ||
|
||
```jsx | ||
<Notice status="error"> | ||
An unknown error occurred. | ||
</Notice> | ||
``` | ||
|
||
For more complex markup, you can pass any JSX element: | ||
|
||
```jsx | ||
<Notice status="error"> | ||
<p>An error occurred: <code>{ errorDetails }</code>.</p> | ||
</Notice> | ||
``` | ||
|
||
### Props | ||
|
||
The following props are used to control the display of the component. | ||
|
||
* `status`: (string) can be `warning` (red), `success` (green), `error` (red), `info` (yellow) | ||
* `content`: (string) the text of the notice | ||
* `onRemove`: function called when dismissing the notice | ||
* `isDismissible`: (bool) defaults to true, whether the notice should be dismissible or not |