Utilities and UI components for cross-platform React Native apps
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: add `Centered` component

Behaves like a `View`, but its children are centered horizontally and vertically.

Joseph Hale (Jan 24, 2026, 11:36 PM -0700) 125bfc47 88f38960

+32
+1
src/index.ts
··· 5 5 // file, You can obtain one at https://mozilla.org/MPL/2.0/. 6 6 7 7 export * from './components'; 8 + export * from './layouts'; 8 9 export * from './theme'; 9 10 export * from './stores'; 10 11 export * from './settings';
+24
src/layouts/Centered.tsx
··· 1 + // Copyright (c) 2026 Joseph Hale 2 + // 3 + // This Source Code Form is subject to the terms of the Mozilla Public 4 + // License, v. 2.0. If a copy of the MPL was not distributed with this 5 + // file, You can obtain one at https://mozilla.org/MPL/2.0/. 6 + import React from "react" 7 + import { StyleSheet, View } from "react-native"; 8 + 9 + export default function Centered(props: React.ComponentProps<typeof View>) { 10 + return ( 11 + <View {...props} style={[props.style, styles.container]}> 12 + {props.children} 13 + </View> 14 + ) 15 + } 16 + 17 + const styles = StyleSheet.create({ 18 + container: { 19 + width: '100%', 20 + height: '100%', 21 + justifyContent: 'center', 22 + alignItems: 'center', 23 + } 24 + });
+7
src/layouts/index.ts
··· 1 + // Copyright (c) 2026 Joseph Hale 2 + // 3 + // This Source Code Form is subject to the terms of the Mozilla Public 4 + // License, v. 2.0. If a copy of the MPL was not distributed with this 5 + // file, You can obtain one at https://mozilla.org/MPL/2.0/. 6 + 7 + export { default as Centered } from './Centered';