Positioning elements, good practices
Use alignItems with HStack
Don't use negative margin or negative position top, to align elements.
Use alignItems with HStack to align elements vertically.
<HStack sx={{ alignItems: "center" }}>
<Icon visual="Check" />
<Text>Text</Text>
</HStack>
Use gap with VStack
Don't use <Spacer />, padding or margin to separate elements.
Use gap with VStack to separate elements vertically even for paragraph.
<VStack gap="$px12">
<Paragraph>{/* paragraph content */}</Paragraph>
<Paragraph>{/* paragraph content */}</Paragraph>
<Box>{/* box content */}</Box>
</VStack>
Use flex to set the width of an element
Don't use width to set the width of an element.
Use flex/flex-grow to set the width of an element.
For example, you want to make a box fill the remaining space of a container, you can do:
<HStack>
<Box sx={{ flex: 1 }} />
</HStack>