View🔗

A View is a generic layout component.

Under the hood, it's basically a <div> element with some sensible defaults:

It supports responsive object or array values for all it's style props. Array values map according to the number of values passed:

Number of values
Responsive style
1default
2default, fromM
3default, fromM, fromL
4default, fromM, fromL, fromXL

All padding and margin values are based on multiples of the baselineGrid which is 8px.

Example🔗

Hello
World

Props - View🔗

Name
Description
Type
Default Value
alignContentSets align-content.customn/a
alignItemsSets align-items.custom'stretch'
alignSelfSets align-self.customn/a
asThe HTML node that is rendered.union(string,element,elementType,func)'div'
backgroundColorA custom background colorcustombg
basisSets flex-basis.custom'auto'
bgA custom background colorcustomn/a
childrenA JSX nodenoden/a
classNameAdds a custom CSS class.stringn/a
directionSets the flex-direction.custom'column'
displaySets display.custom'flex'
extendExtends the Fela style object.union(object,func,array)n/a
flexSets flex.customn/a
growSets flex-grow.custom0
heightSets height.customn/a
justifyContentSets justify-content.customn/a
marginAdds margin based on the baselineGrid. Overwritten by specific directional margins.customn/a
marginBottomAdds bottom margin based on the baselineGrid.customn/a
marginLeftAdds left margin based on the baselineGrid.customn/a
marginRightAdds right margin based on the baselineGrid.customn/a
marginTopAdds top margin based on the baselineGrid.customn/a
maxHeightSets max-height.customn/a
maxWidthSets max-width.customn/a
minHeightSets min-height.customn/a
minWidthSets min-width.customn/a
orderSets order.customn/a
paddingAdds padding based on the baselineGrid. Overwritten by specific directional paddings.customn/a
paddingBottomAdds bottom padding based on the baselineGrid.customn/a
paddingLeftAdds left padding based on the baselineGrid.customn/a
paddingRightAdds right padding based on the baselineGrid.customn/a
paddingTopAdds top padding based on the baselineGrid.customn/a
shrinkSets flex-shrink.custom0
spacingAdds spacing between children based on the baselineGrid.customn/a
styleAdds inline styles.objectn/a
widthSets width.customn/a
wrapSets flex-wrap.custom'nowrap'
2022 © Volvo Car Corporation