}
- placeholder={
{placeholder}}
+ contentEditable={
+
+ }
ErrorBoundary={LexicalErrorBoundary}
/>
diff --git a/packages/lexical-playground/src/ui/ContentEditable.css b/packages/lexical-playground/src/ui/ContentEditable.css
index 319b2ca1839..efced7fc1bc 100644
--- a/packages/lexical-playground/src/ui/ContentEditable.css
+++ b/packages/lexical-playground/src/ui/ContentEditable.css
@@ -21,3 +21,24 @@
padding-right: 8px;
}
}
+
+.ContentEditable__placeholder {
+ font-size: 15px;
+ color: #999;
+ overflow: hidden;
+ position: absolute;
+ text-overflow: ellipsis;
+ top: 8px;
+ left: 28px;
+ right: 28px;
+ user-select: none;
+ white-space: nowrap;
+ display: inline-block;
+ pointer-events: none;
+}
+@media (max-width: 1025px) {
+ .ContentEditable__placeholder {
+ left: 8px;
+ right: 8px;
+ }
+}
diff --git a/packages/lexical-playground/src/ui/ContentEditable.tsx b/packages/lexical-playground/src/ui/ContentEditable.tsx
index 9301f5f0c2c..b1ee20b2103 100644
--- a/packages/lexical-playground/src/ui/ContentEditable.tsx
+++ b/packages/lexical-playground/src/ui/ContentEditable.tsx
@@ -11,10 +11,26 @@ import './ContentEditable.css';
import {ContentEditable} from '@lexical/react/LexicalContentEditable';
import * as React from 'react';
+type Props = {
+ className?: string;
+ placeholderClassName?: string;
+ placeholder: string;
+};
+
export default function LexicalContentEditable({
className,
-}: {
- className?: string;
-}): JSX.Element {
- return
;
+ placeholder,
+ placeholderClassName,
+}: Props): JSX.Element {
+ return (
+
+ {placeholder}
+
+ }
+ />
+ );
}
diff --git a/packages/lexical-playground/src/ui/Placeholder.css b/packages/lexical-playground/src/ui/Placeholder.css
deleted file mode 100644
index 61e3df765fb..00000000000
--- a/packages/lexical-playground/src/ui/Placeholder.css
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- *
- */
-
-.Placeholder__root {
- font-size: 15px;
- color: #999;
- overflow: hidden;
- position: absolute;
- text-overflow: ellipsis;
- top: 8px;
- left: 28px;
- right: 28px;
- user-select: none;
- white-space: nowrap;
- display: inline-block;
- pointer-events: none;
-}
-@media (max-width: 1025px) {
- .Placeholder__root {
- left: 8px;
- }
-}
diff --git a/packages/lexical-playground/src/ui/Placeholder.tsx b/packages/lexical-playground/src/ui/Placeholder.tsx
deleted file mode 100644
index 67677688683..00000000000
--- a/packages/lexical-playground/src/ui/Placeholder.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- */
-
-import './Placeholder.css';
-
-import * as React from 'react';
-import {ReactNode} from 'react';
-
-export default function Placeholder({
- children,
- className,
-}: {
- children: ReactNode;
- className?: string;
-}): JSX.Element {
- return