React Native UI documentation
@sohantalukder/rn-kit
A typed React Native UI kit with theme primitives, polished components, and overlay providers.
Quick start
Install the package, mount providers at the app root, and copy a complete screen pattern with state, validation, and feedback.
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>
);
}