@ruby-native/react
v0.9.0
Published
React components for Ruby Native
Readme
@ruby-native/react
React components for Ruby Native. Use these in an Inertia.js + React app to emit the signal elements that Ruby Native's iOS and Android apps read to render native tabs, navigation bars, forms, and more.
Install
npm install @ruby-native/reactUsage
import { NativeTabs, NativeNavbar, NativeButton, NativeForm } from "@ruby-native/react"
export default function Show({ product }) {
return (
<>
<NativeNavbar title={product.name}>
<NativeButton icon="bag" href="/cart" />
</NativeNavbar>
<NativeForm />
{/* your page content */}
</>
)
}Each component renders a hidden data-native-* signal element that the Ruby Native runtime picks up and turns into the corresponding native UI.
Components
NativeTabs- show the native tab barNativePush- request push notification permissionNativeForm- mark the current page as a form so back navigation skips itNativeNavbar- native navigation bar with title and buttonsNativeButton- native nav bar button (icon, title, href, or click target)NativeMenuItem- item inside a native menuNativeSubmitButton- native "Save" button that submits a formNativeOverscroll- per-page overscroll colors
Docs
Full guides at rubynative.com/docs.
License
MIT
