Skip to content

Commit

Permalink
feat: added placeholder example
Browse files Browse the repository at this point in the history
  • Loading branch information
ezhil56x committed Nov 17, 2024
1 parent 8c6eaf0 commit ef431a8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/01-basic/11-placeholder/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ import { useCreateBlockNote } from "@blocknote/react";
import { locales } from "@blocknote/core";

export default function App() {
// Set the user locale.
const userLocale = "en";

const placeholder = "This is a custom placeholder";

// Creates a new editor instance.
const editor = useCreateBlockNote({
dictionary: {
...locales.en,
...locales[userLocale],
placeholders: {
...locales.en.placeholders,
default: placeholder ?? locales.en.placeholders.default,
...locales[userLocale].placeholders,
default: placeholder ?? locales[userLocale].placeholders.default,
},
},
});
Expand Down

0 comments on commit ef431a8

Please sign in to comment.