Use the theme-based parameters when possible to avoid discrepencies between the design-system and the layout.
The flexDirection=reverse
property should only be used for user experience purposes to affect the tab order. An example would be that the submit button is on the right and we want the user to tab there first instead of the Cancel button which is on the left.
The Flex
component is an extension of the Box component which adds flex-based styling.
It has all the props from Box
, plus all flex container and flex item props.
It also has a subcomponent, Flex.Item
, with just the flex item props.
IE doesn’t have the greatest flex support. We have a couple built-in workarounds, but even then if you need IE support be careful and test thoroughly.
justifyContent="space-evenly"
is not supported, but is faked by adding empty ::before
& ::after
pseudo-elements and using space-between
. Don’t try to combine this with an element that already has such pseudo-elements.gap
(or rowGap
& colGap
) is not supported at all, but that’s worked around by setting the margins on all direct children to calc([gap] / 2)
.All Box props, plus:
as
prop from styled-components