Example apps
Complete apps that sign in and show UI kit components, in the sApp release repository.
Short examples
An order list on each platform, inside the provider that holds the client and the theme.
SwiftUI
import SAppUI
SuperrouteScope(client: client, theme: ThemeTokens(branding: branding)) {
OrderList(onOpen: { type, id in openOrder(type, id) })
}
Jetpack Compose
SuperrouteScope(client = client, theme = ThemeTokens(branding)) {
OrderList(onOpen = { type, id -> openOrder(type, id) })
}
React Native
import { OrderList } from '@superrouteca/sapp-react-native/ui';
<SuperrouteProvider client={sr}><OrderList onOpen={({ type, id }) => openOrder(type, id)} /></SuperrouteProvider>
Web / React
import { configure } from '@superrouteca/sapp-ui';
configure({ client: sr, theme: themeFromBranding(branding), locale: 'en' });
// <sr-order-list></sr-order-list> raises sr-open with { type, id }
import { OrderList } from '@superrouteca/sapp-react/ui';
<SuperrouteProvider client={sr}><OrderList onOpen={({ type, id }) => openOrder(type, id)} /></SuperrouteProvider>
Flutter
SuperrouteScope(client: sr, theme: ThemeTokens.fromBranding(branding), child: SrOrderList(onOpen: openOrder))