#Text - whitespace trim & bolds

2 messages · Page 1 of 1 (latest)

haughty elbow
#

Main question: I realized the Text component automatically trims white-spaces and there is no prop to turn off this behaviors. What workarounds do you have and shouldn't that be an option?
If you are wondering, the reason why I'm using edge white spaces is because I'm conditionally rendering some strings and the separator between them involves spaces like this " / " .

Extra: how do you deal with bolds in the middle of a Text? Do you create a new Text, maybe as span? I'd love to have a more neat option than that.

formal sail
# haughty elbow Main question: I realized the Text component automatically trims white-spaces an...

Text component does not trim its value, it renders children the same way they would be rendered inside div element – https://codesandbox.io/s/great-sun-zpxlh1?file=/src/App.tsx

great-sun-zpxlh1 by rtivital using @emotion/react, @mantine/carousel, @mantine/core, @mantine/dates, @mantine/dropzone, @mantine/form, @mantine/hooks, @mantine/modals, @mantine/notifications