How to make Chakra's <Text> component inline?

Viewed 4135

I can't figure our how to make the Chakra component inline. Read the documentation but couldn't figure out the right property or if this is a css class thing.

<Text> Hello World, </Text>
<Text> place me next to the Text above! </Text>
2 Answers

ChakraUI documentation on <Text> component explains that it renders a <p> tag by default.

But, you can swap it to work as a <span> tag, by giving <Text> the as prop. Like this:

<Text as="span"> Hello World, </Text>
<Text as="span"> place me next to the Text above! </Text>

You can use Flex for this

<Flex>
<Text> Hello World, </Text>
<Text> place me next to the Text above! </Text>
</Flex>
Related