New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equivalent to Blueprint's RunningText #14876
Comments
@nmain We don't have such a component. For the markdown problem. You have two options:
n°1 has the advantage of being fully idiomatic with React. The drawback is that it's x5 slower than n°2. |
So what I'm proposing is a component that implements style rules similar to line 105 here: be added to MaterialUI. |
A similar concept component for benchmark: https://elastic.github.io/eui/#/display/text. |
I'm also looking for something like this. Is there any reason not to just copy MarkdownElement pretty much as-is and rename it to RunningText? Would you accept a PR for something like this? |
A
<RunningText>
component would apply typography styles to basic html elements in it, so something like this:Would behave like this:
Expected Behavior 🤔
Within a
<RunningText>
all of the styles normally applied by<Typography>
would be applied to the corresponding plain html elements.Current Behavior 😯
If you want to render markdown in Material-UI, you have to use something like https://github.com/remarkjs/remark-react and its
remarkReactComponents
to make transformations like<h2>
=><Typography variant="h2">
. If you want to render arbitrary rich text from something like ProseMirror, you have to use something like https://github.com/remarkablemark/html-react-parser/ and itsreplace
functionality to do the same. If you want to render rich text from a contenteditable with WYSIWYG, you're out of luck because there's no way to use<Typography>
in the editing control of things like ProseMirror.Examples 🌈
Blueprint.js is React component library unrelated to Material Design. It has a feature like this, documented here as "RUNNING_TEXT": https://blueprintjs.com/docs/#core/components/html
Context 🔦
I listed some specific use cases in Current Behavior, but basically any situation where you want to render basic document content that might be dynamically generated and where using lots of
<Typography>
elements would be difficult.Benchmark
The text was updated successfully, but these errors were encountered: