@sohantalukder/rn-kit
A typed React Native UI kit with theme primitives, polished components, and overlay providers.
Install
npm install @sohantalukder/rn-kitnpm install react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svgUsage
import { useState } from 'react';
import { View } from 'react-native';
import {
Button,
Card,
Text,
TextInput,
ThemeProvider,
UiPortalProvider,
toast,
useTheme,
} from '@sohantalukder/rn-kit';
function AccountScreen() {
const [email, setEmail] = useState('');
const [isSubmitting, setIsSubmitting] = useState(false);
const { gutters, layout } = useTheme();
const emailError =
email.length > 0 && !email.includes('@')
? 'Enter a valid email address.'
: undefined;
const handleSubmit = () => {
if (!email || emailError) {
toast.show({ type: 'error', title: 'Add a valid email first' });
return;
}
setIsSubmitting(true);
toast.show({ type: 'success', title: 'Profile saved' });
setTimeout(() => setIsSubmitting(false), 800);
};
return (
<View style={[layout.flex_1, layout.justifyCenter, gutters.padding_24]}>
<Card variant="outlined" style={gutters.gap_16}>
<Text variant="heading3" weight="semibold">
Account setup
</Text>
<Text color="secondary">
Use controlled fields and let rn-kit handle theme-aware states.
</Text>
<TextInput
label="Email"
placeholder="you@example.com"
keyboardType="email-address"
autoCapitalize="none"
value={email}
errorMessage={emailError}
onChangeText={(value) => setEmail(value)}
/>
<Button
text="Save profile"
accessibilityLabel="Save profile"
disabled={!email || Boolean(emailError)}
isLoading={isSubmitting}
onPress={handleSubmit}
/>
</Card>
</View>
);
}
export function App() {
return (
<ThemeProvider>
<UiPortalProvider>
<AccountScreen />
</UiPortalProvider>
</ThemeProvider>
);
}Components
Every public component is documented as part of one library surface, with import snippets, props, variants, and custom previews.
Docs Workflow
The custom docs app is the source of truth for browsing the package, checking examples, and sharing component usage with app teams.
npm run docs:dev