UI & Components
Solid Native components compile directly to native Fabric views through Solid 2's universal renderer. Signal updates patch only the affected native prop or text leaf—components never re-run on state changes.
Basic component#
tsx
/** @jsxImportSource @solidnative-dev/core */
import { createSignal } from "solid-js";
import {
Button,
SafeAreaView,
StyleSheet,
Text,
View,
} from "@solidnative-dev/core";
const styles = StyleSheet.create({
screen: { flex: 1, padding: 24, gap: 16, justifyContent: "center" },
title: { fontSize: 28, fontWeight: "700" },
counter: { fontSize: 18 },
});
export function ProfileCard() {
const [likes, setLikes] = createSignal(0);
return (
<SafeAreaView style={styles.screen}>
<Text style={styles.title}>Solid Native</Text>
<View>
<Text style={styles.counter}>Likes: {likes()}</Text>
</View>
<Button title="Like" onPress={() => setLikes((n) => n + 1)} />
</SafeAreaView>
);
}Core UI primitives#
Exported from @solidnative-dev/core:
| Category | Primitives |
|---|---|
| Layout & safe area | View, SafeAreaProvider, SafeAreaView, KeyboardAvoidingView, StatusBar |
| Text & media | Text, Image, ActivityIndicator |
| Input & controls | Button, Pressable, TextInput, TextInputFocusGroup, Switch |
| Scrolling & lists | ScrollView, RefreshableScrollView, KeyboardAwareScrollView, VirtualizedList |
| Overlays & screens | Modal, Screen, ScreenStack, ScreenHeader, TabsHost, TabsScreen |
| Styling | StyleSheet.create, StyleSheet.compose, StyleSheet.flatten, absoluteFill |
Platform packages#
Native device capabilities ship as separate, React-free packages with typed Solid bindings:
| Package | Capability |
|---|---|
@solidnative-dev/storage | Bounded key-value persistence (AsyncStorage 3 backend) |
@solidnative-dev/secure-storage | iOS Keychain / Android Keystore secrets |
@solidnative-dev/networking | Bounded HTTP requests, JSON resources, and SSE streams |
@solidnative-dev/camera | Native camera preview and capture |
@solidnative-dev/notifications | Local & push notification permissions and events |
@solidnative-dev/dialogs | Native platform alerts and confirmation sheets |
@solidnative-dev/sharing | Native iOS/Android share sheet |
@solidnative-dev/clipboard | Clipboard read/write |
@solidnative-dev/localization | Locale, RTL, and currency/region reactivity |
@solidnative-dev/accessibility | Screen-reader state, reduce-motion, and announcements |
@solidnative-dev/vibration | Haptic feedback and vibration patterns |