Package overview¶
PythonNative re-exports a small public surface from
pythonnative/__init__.py. Most user code only ever touches the names
in this overview; deeper internals (reconciler, native_views,
page) are documented for contributors and integrators.
Entry point¶
Your app module defines a top-level component named App:
The bundled Android ScreenFragment and iOS ViewController load
your app by module path ("app.main") and look up the
module's top-level App attribute. There is no registration step
or imperative bootstrap call. If you need to expose a
differently-named root component, configure the templates to load
an explicit dotted path like "app.main.RootScreen" instead.
PythonNative: declarative native UI for Android and iOS.
PythonNative is a cross-platform toolkit that turns Python @component
functions into real, native Android and iOS views. The component model
is React-like (function components plus hooks), but rendering happens
through direct platform bindings: Chaquopy on Android (Java) and
rubicon-objc on iOS (Objective-C). There is no JavaScript bridge.
Key building blocks:
- Element factories (
Text,Button,Column, etc.) return immutableElementdescriptors. - Hooks (
use_state,use_effect,use_reducer, etc.) manage state, side effects, and context inside@componentfunctions. - Navigation is built from
NavigationContainerplus one of thecreate_stack_navigator,create_tab_navigator, orcreate_drawer_navigatorfactories. - Styling uses a single
styledict per element (or a list of dicts), composable viaStyleSheet. PythonNative ships a fully-typedStyleTypedDict so editors andmypyvalidate every key as you type. - Animations use the
Animatednamespace, modeled on React Native's animation API. - Custom native components can be authored with the
pythonnative.sdkpackage: define a typedPropsdataclass, implement aViewHandlerfor each platform, and register it via@native_component(or expose it from a PyPI package via thepythonnative.handlersentry-point group).
Example
Where to look next¶
The reference is split per module so each page stays scannable:
Property reference¶
All visual and layout properties pass through the style dict (or a
list of dicts). The full per-component property catalogue lives in
Component properties.