@getsoren/react-native-design-system
v1.64.1
Published
Design System mobile
Readme
@getsoren/react-native-design-system
Design System for mobile
Installation
Basic installation:
npm:
npm install @getsoren/react-native-design-systempnpm:
pnpm add @getsoren/react-native-design-systemyarn:
yarn add @getsoren/react-native-design-systembun:
bun add @getsoren/react-native-design-systemRequired peer dependency: react-native-keyboard-controller
Every component that has to step aside for the keyboard (BottomSheet, Autocomplete, the chat participant
modal) follows it through this library rather than React Native's KeyboardAvoidingView, which configures its
animation before it commits — so a render already in flight takes it and the padding lands with no animation at
all — and which animates nothing on the way back.
npx expo install react-native-keyboard-controller react-native-reanimated react-native-workletsIt brings native modules, so it needs a development build; Expo Go ships its own copy. The three are installed
directly and not left to npm: a native module's compiled side must match the package in node_modules, and
expo-doctor fails when a native peer dependency is only resolved transitively.
The app then mounts KeyboardProvider above everything else, otherwise those components raise at their first
keyboard:
import { KeyboardProvider } from "react-native-keyboard-controller";
const App = () => (
<KeyboardProvider>
<ThemeProvider>{...}</ThemeProvider>
</KeyboardProvider>
);Optional peer dependencies
If you want to use the following components, you need to install the following dependencies:
@react-native-community/datetimepickerandexpo-localizationTimePickercomponentTimeRangePickercomponent
expo-localizationDatePickercomponentDateRangePickercomponent
expo-document-picker,expo-image-picker,expo-linkingFilecomponent
expo-imageAvatarcomponentSelectcomponent (image options)TimeLineEventscomponent
expo-routerHeaderBackButtoncomponentModalIconButtoncomponent
expo-status-barModalLayoutcomponent
expo-mapsMapMarkerscomponent
react-native-safe-area-contextAutocompletecomponentBottomFixedButtoncomponentBottomSheetContentcomponentHeadercomponent
react-native-svgIconcomponent
expo-file-system,expo-sharing,react-native-webLightboxcomponent
@shopify/flash-listandexpo-dev-clientAutocompletecomponentCardProductListcomponentChatcomponent
Installation with all optional dependencies
npm:
npm install @getsoren/react-native-design-system @react-native-community/datetimepicker expo-document-picker expo-image expo-image-picker expo-linking expo-localization expo-router expo-status-bar react-native-maps react-native-safe-area-context react-native-svgpnpm:
pnpm add @getsoren/react-native-design-system @react-native-community/datetimepicker expo-document-picker expo-image-picker expo-linking expo-localization expo-router expo-status-bar react-native-maps react-native-safe-area-context react-native-svgyarn:
yarn add @getsoren/react-native-design-system @react-native-community/datetimepicker expo-document-picker expo-image-picker expo-linking expo-localization expo-router expo-status-bar react-native-maps react-native-safe-area-context react-native-svgbun:
bun add @getsoren/react-native-design-system @react-native-community/datetimepicker expo-document-picker expo-image-picker expo-linking expo-localization expo-router expo-status-bar react-native-maps react-native-safe-area-context react-native-svgUsage
import { ThemeProvider } from "@getsoren/react-native-design-system";
const App = () => {
return (
<ThemeProvider>
<MyComponent />
</ThemeProvider>
);
};Load custom font
import { ThemeProvider } from "@getsoren/react-native-design-system";
import { useFonts } from "expo-font";
import * as SplashScreen from "expo-splash-screen";
const App = () => {
const [loaded, error] = useFonts({
"Poppins-Medium": require("../assets/fonts/Poppins-Medium.ttf"), // 500
"Poppins-Regular": require("../assets/fonts/Poppins-Regular.ttf"), // 400
"Poppins-SemiBold": require("../assets/fonts/Poppins-SemiBold.ttf"), // 600
});
useEffect(() => {
if (loaded || error) {
SplashScreen.hideAsync().then();
}
}, [loaded]);
if (!loaded) {
return null;
}
return (
<ThemeProvider
fonts={{
medium: "Poppins-Medium",
regular: "Poppins-Regular",
semiBold: "Poppins-SemiBold",
}}
>
<MyComponent />
</ThemeProvider>
)
};Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
