Skip to content

Commit

Permalink
Documentation Update: move placeholder examples to ContentEditable (
Browse files Browse the repository at this point in the history
  • Loading branch information
RobHannay authored Feb 17, 2025
1 parent 9deab94 commit 0e98db1
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 14 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ function Editor() {
return (
<LexicalComposer initialConfig={initialConfig}>
<PlainTextPlugin
contentEditable={<ContentEditable />}
placeholder={<div>Enter some text...</div>}
contentEditable={
<ContentEditable
aria-placeholder={'Enter some text...'}
placeholder={<div>Enter some text...</div>}
/>
}
ErrorBoundary={LexicalErrorBoundary}
/>
<OnChangePlugin onChange={onChange} />
Expand Down
8 changes: 6 additions & 2 deletions packages/lexical-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ function Editor() {
return (
<LexicalComposer initialConfig={initialConfig}>
<PlainTextPlugin
contentEditable={<ContentEditable />}
placeholder={<div>Enter some text...</div>}
contentEditable={
<ContentEditable
aria-placeholder={'Enter some text...'}
placeholder={<div>Enter some text...</div>}
/>
}
/>
<OnChangePlugin onChange={onChange} />
<HistoryPlugin />
Expand Down
16 changes: 12 additions & 4 deletions packages/lexical-website/docs/getting-started/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ function Editor() {
return (
<LexicalComposer initialConfig={initialConfig}>
<RichTextPlugin
contentEditable={<ContentEditable />}
placeholder={<div>Enter some text...</div>}
contentEditable={
<ContentEditable
aria-placeholder={'Enter some text...'}
placeholder={<div>Enter some text...</div>}
/>
}
ErrorBoundary={LexicalErrorBoundary}
/>
<HistoryPlugin />
Expand Down Expand Up @@ -135,8 +139,12 @@ function Editor() {
return (
<LexicalComposer initialConfig={initialConfig}>
<RichTextPlugin
contentEditable={<ContentEditable />}
placeholder={<div>Enter some text...</div>}
contentEditable={
<ContentEditable
aria-placeholder={'Enter some text...'}
placeholder={<div>Enter some text...</div>}
/>
}
ErrorBoundary={LexicalErrorBoundary}
/>
<HistoryPlugin />
Expand Down
8 changes: 6 additions & 2 deletions packages/lexical-website/docs/getting-started/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ export default function Editor() {
return (
<LexicalComposer initialConfig={initialConfig}>
<PlainTextPlugin
contentEditable={<ContentEditable />}
placeholder={<div className="editor-placeholder">Enter some text...</div>}
contentEditable={
<ContentEditable
aria-placeholder={'Enter some text...'}
placeholder={<div className="editor-placeholder">Enter some text...</div>}
/>
}
ErrorBoundary={LexicalErrorBoundary}
/>
</LexicalComposer>
Expand Down
16 changes: 12 additions & 4 deletions packages/lexical-website/docs/react/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ React wrapper for `@lexical/plain-text` that adds major features for plain text

```jsx
<PlainTextPlugin
contentEditable={<ContentEditable />}
placeholder={<div>Enter some text...</div>}
contentEditable={
<ContentEditable
aria-placeholder={'Enter some text...'}
placeholder={<div>Enter some text...</div>}
/>
}
ErrorBoundary={LexicalErrorBoundary}
/>
```
Expand All @@ -57,8 +61,12 @@ React wrapper for `@lexical/rich-text` that adds major features for rich text ed

```jsx
<RichTextPlugin
contentEditable={<ContentEditable />}
placeholder={<div>Enter some text...</div>}
contentEditable={
<ContentEditable
aria-placeholder={'Enter some text...'}
placeholder={<div>Enter some text...</div>}
/>
}
ErrorBoundary={LexicalErrorBoundary}
/>
```
Expand Down

0 comments on commit 0e98db1

Please sign in to comment.