Skip to content

Any way to change the default element? #590

Answered by zbeyens
zeddotes asked this question in Q&A
Discussion options

You must be logged in to vote

What do you mean by paragraph? Slate node type: 'p' or React component <p>, or the plugin key?

  • You can customize the node type by adding this to getSlatePluginsOptions: [ELEMENT_DEFAULT]: { type: 'anything' }
  • You can customize the component by adding this to getSlatePluginsComponents: [ELEMENT_DEFAULT]: getComponent(StyledElement, { as: 'div' }), or any other component
  • You can't customize their plugin keys, if you want ELEMENT_DEFAULT being different than ELEMENT_PARAGRAPH, that's not supported yet, they're both equal to 'p'. Solution would be to PR or create another paragraph plugin that uses another key.

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zeddotes
Comment options

Answer selected by zbeyens
Comment options

You must be logged in to vote
1 reply
@12joan
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
5 participants
Converted from issue

This discussion was converted from issue #588 on March 24, 2021 18:14.