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>
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>
You can use Flex for this
<Flex>
<Text> Hello World, </Text>
<Text> place me next to the Text above! </Text>
</Flex>
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>
I found the <Stack>
tag useful. You can stack items horizontally as well as vertically:
<Stack direction='row'>
<Text>Hello World, </Text>
<Text>place me next to the Text above!</Text>
</Stack>
Alternatively there is a tag called <HStack>
that does the same thing:
<HStack>
<Text>Hello World, </Text>
<Text>place me next to the Text above!</Text>
</HStack>
This results in: "Hello World, place me next to the Text above!"
© 2022 - 2024 — McMap. All rights reserved.