Skip to main content

StyledView

StyledView component render a view that can easily be re-style by using props.

Implementation code

import { StyledView, Stack } from '@nexara/nativeflow';

const Component = () => {
return (
<StyledView f={1} >
<StyledView h={100} w={100} bg='red'></StyledView>
</StyledView>
);
}
export default Component;

Props

PropTypeDefaultDescription
fnumberFlex value controlling the growth, shrink, and basis of the view.
alignViewStyle['alignItems']Aligns children along the cross axis (alignItems).
justifyViewStyle['justifyContent']Aligns children along the main axis (justifyContent).
fWrapViewStyle['flexWrap']Determines if children wrap when exceeding the container size.
bgstringSets a custom background color for the view.
themeBgbooleanfalseIf true, applies the theme's background color instead of the bg value.
hDimensionValueSets the height of the view in pixels (number) or percentage (string).
wDimensionValueSets the width of the view in pixels (number) or percentage (string).
styleStyleProp<ViewStyle>Additional custom styles applied to the view, which override or extend default styles.
childrenReact.ReactNodeChild components or elements rendered inside the view.
refReact.Ref<View>Ref to access the underlying View component for imperative operations.