Skip to content

Commit

Permalink
Document the new attributeKey prop for RichText component
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Dec 14, 2024
1 parent 2cd096c commit a051d8a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/block-editor/src/components/rich-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ _Required._ Called when the value changes.

_Optional._ If the editable field is bound to a block attribute (through the `value` and `onChange` props) then this prop should specify the attribute name. The field will use this value to set the block editor selection correctly, specifying in which attribute and at what offset does the selection start or end.

### `attributeKey: String`

_Optional._ If the editable field is bound to a block attribute, then this prop should specify the key of the attribute. The editable field will use the key name to supply the default handling for the `value`, `onChange` and `identifier` props, when any of these are not explicitly set.

### `tagName: String`

_Default: `div`._ The [tag name](https://www.w3.org/TR/html51/syntax.html#tag-name) of the editable element.
Expand All @@ -27,7 +31,7 @@ _Optional._ Placeholder text to show when the field is empty, similar to the

### `disableLineBreaks: Boolean`

_Optional._ Disables inserting line breaks on `Enter` when it is set to `true`
_Optional._ Disables inserting line breaks on `Enter` when it is set to `true`

### `onReplace( blocks: Array ): Function`

Expand Down Expand Up @@ -113,14 +117,12 @@ registerBlockType( /* ... */, {
} );
```


## RichTextToolbarButton

Slot to extend the format toolbar. Use it in the edit function of a `registerFormatType` call to surface the format to the UI.

### Example


```js
import { registerFormatType } from '@wordpress/rich-text';
import { RichTextToolbarButton } from '@wordpress/block-editor';
Expand Down

0 comments on commit a051d8a

Please sign in to comment.