Mobile

Mobile-specific design patterns for iOS and Android using Tauri 2.0 mobile.


Platform Detection

Use usePlatform() hook for platform-specific behavior:

const { platform, isMobile, isDesktop, safeAreaInsets } = usePlatform();
// platform: 'ios' | 'android' | 'macos' | 'windows' | 'linux'

iOS Human Interface Guidelines

Constants from src/lib/constants/ios-styles.ts:

Touch Targets

All interactive elements must be at least 44pt (iOS standard).

export const IOS_TOUCH_TARGET = 44;

Chevron Specs

Type
Size
Stroke
Color

Disclosure (forward)

14px

2.5

Stone #A1A1AA

Back

14px

2.5

Ember (tint color)

Timing

Type
Duration

Long press

500ms

Animation (standard)

300ms

Animation (fast)

150ms

Tab Bar

  • Height: 49pt (excluding safe area)

  • Bottom safe area is added automatically


Safe Areas

Mobile components must respect safe areas (notch, home indicator):

Use in headers:


Bottom Sheets

Replaces modals on mobile. Uses Drawer with bottom position.

Component: src/components/mobile/primitives/BottomSheet.tsx

Key styling:

  • Border radius: 16px (top corners only)

  • Animation: 320ms cubic-bezier (iOS-style deceleration)

  • Overlay: 0.35 opacity with 2px blur

  • Drag handle: 36×4px centered gray bar


Action Sheets

iOS-style context menus. Replaces right-click menus from desktop.

Component: src/components/mobile/primitives/ActionSheet.tsx

Features:

  • Danger actions shown at bottom with red text

  • Cancel button always present

  • 56px min-height rows for touch targets


Swipeable Rows

List items with swipe actions + rubber-band physics.

Component: src/components/mobile/primitives/SwipeableRow.tsx

Physics:

  • Swipe threshold: 80px

  • Action width: 72px

  • Rubber-band factor: 0.3 (over-swipe resistance)

  • Spring physics on release

  • Haptic feedback at threshold crossing


Floating Action Button (FAB)

Primary action button positioned above tab bar.

Component: src/components/mobile/primitives/FAB.tsx

Positioning:

  • Right: 16px

  • Bottom: Tab bar height + safe area + 32px

  • Size: 56×56px, 28px radius

  • Color: Ember with 30% shadow

Behavior:

  • Spring animation on mount/unmount

  • Hides on scroll down, shows on scroll up

  • Haptic feedback on tap

  • Respects reduced motion preferences


Pull to Refresh

Native-feel refresh gesture.

Component: src/components/mobile/primitives/PullToRefresh.tsx

Behavior:

  • Threshold: 80px

  • Max pull: 120px

  • Resistance: 0.5 (progressive)

  • Icon rotates proportionally to pull distance

  • Ember color when ready to trigger


Mobile View Header

Consistent header with back navigation and actions.

Component: src/components/mobile/primitives/MobileViewHeader.tsx

Height variants:

Variant
Height

default

44pt

compact

44pt

large

96pt


Haptic Feedback

Use useHaptics() hook:


Gesture Patterns

Long Press

Trigger duration: 500ms. Use for context menus.

Scroll Direction

Use useScrollDirection() to show/hide toolbars:


Mobile-Specific Hooks

Hook
Purpose

usePlatform()

Platform detection, safe area insets

useHaptics()

Haptic feedback (vibration)

useBiometric()

Face ID, fingerprint auth

useQRScanner()

QR code scanning for device pairing

useNotifications()

Push notifications

useAppIcon()

Dynamic app icon switching

useShareHandler()

Handle share intents from other apps

useBackgroundTask()

Background task scheduling

useDeepLinks()

Deep link handling

useScrollDirection()

Scroll direction detection

useReducedMotion()

Respect accessibility preference


Component Directory Structure

Last updated