@edon-app/common
v1.0.6
Published
Use NPM or Yarn to install as a development dependency:
Readme
Installation
Use NPM or Yarn to install as a development dependency:
# with NPM
npm install @edon-app/common
# with Yarn
yarn add @edon-app/commonFlat List Layers
wrapper around React Native’s FlatList for rendering items.
- It accepts all
FlatListprops except forchildren. - Instead of using
renderItemdirectly, it takes achildrenrender function to display each item.
Native Styled
This module defines styled components based on React Native primitives and Tamagui.
KeyboardAvoidingView
- A styled version of
KeyboardAvoidingViewfrom React Native
- A styled version of
SafeAreaView
- A styled
SafeAreaViewwith Tamagui - Default background color:
$color3, with flex properties to occupy full height
- A styled
ImageBackground
- A styled
ImageBackgroundwith Tamagui - Similar flex defaults as
SafeAreaView
- A styled
Col
- A styled version of
Stackwith a media variant mediatakes a numeric value and adjusts thewidthin percentage dynamically
- A styled version of
Example
<SafeAreaView>
<KeyboardAvoidingView>
<Col media={50}>
<Text>Half-width Column</Text>
</Col>
</KeyboardAvoidingView>
</SafeAreaView>resolvers
Refer to resolver
SafeArea
The SafeArea component provides a safe rendering area for React Native applications.
It:
- Uses SafeAreaView to render the inner content.
- Displays a StatusBar with a customizable style (
light-contentordark-content). - Supports ImageBackground to wrap the content with a background image if needed.
- If
imageBackgroundis provided, the content will be rendered inside anImageBackground. - Otherwise, it simply renders a Fragment containing the
StatusBarand the content.
✅ Props
barStyle→ Status bar style (light-contentordark-content)style→ Style props for the SafeAreaViewimageBackground→ Props for the background image
Example
<SafeArea
barStyle="dark-content"
style={{ flex: 1, backgroundColor: "white" }}
imageBackground={{ source: require("./bg.png") }}
>
<Text>Hello Safe Area</Text>
</SafeArea>