CruciDrive exports a set of pre-built Glassmorphic components fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DavidCevallos15/Crucidrive---APP/llms.txt
Use this file to discover all available pages before exploring further.
src/components/index.ts. All components consume design tokens from theme.ts and use expo-blur for backdrop blur effects. Importing from the barrel export guarantees you always get the platform-correct variant — on web, Map resolves to Map.web.tsx automatically via the Metro bundler’s platform extension resolution.
GlassCard
A translucent card container with backdrop blur, a glass border, and a soft diffuse shadow. It is the primary surface for ride info panels, driver cards, and any content that floats above the map.Props
Intensity of the
expo-blur BlurView effect, on a scale of 0–100. Defaults to EFFECTS.blurIntensity from the theme.Controls the border color.
default uses the standard glass border (rgba(255,255,255,0.12)), highlight uses COLORS.primaryLight (teal), and danger uses COLORS.danger (red) for error or emergency states.Corner radius in dp. Defaults to
SHAPES.borderRadiusMd.When
true, removes the default 16dp internal padding. Use this when you want to compose custom padding from within the card’s children.Additional styles applied to the outer
View container (not the BlurView). Use this for flex, width, margin etc.Usage
GlassButton
A pressable button with a press-scale animation (0.97) driven by react-native-reanimated and react-native-gesture-handler. Supports four visual variants, three size presets, a loading state that swaps the label for an ActivityIndicator, and an optional left icon slot.
Props
The text rendered inside the button. Also used as the
accessibilityLabel.Callback fired when the tap gesture completes successfully.
Visual style.
primary → teal background; secondary → amber background; danger → red background; ghost → transparent with glass border.Button height and horizontal padding.
sm = 40dp height, md = 48dp, lg = 56dp.When
true, the button renders at 40% opacity and the gesture is blocked.When
true, the label is replaced with an ActivityIndicator and the gesture is blocked.Optional React element rendered to the left of the label (e.g. an
Ionicons icon).Additional styles applied to the animated container.
Usage
GlassInput
A text input field with a glass background, an animated border that transitions toCOLORS.primaryLight on focus and COLORS.danger on validation error, and a persistent visible label above the field. The border animation uses withTiming from Reanimated at ANIMATION.durationFast (150 ms).
Props
Visible label rendered above the input. Used as
accessibilityLabel. Do not rely on placeholder alone for accessibility.When provided, the border turns red and this string is displayed below the input as an error message with
accessibilityRole="alert".Displayed below the input in muted text when there is no error. Useful for format hints.
Appends a red asterisk (
*) to the label.Additional styles for the outermost
View wrapper.TextInput component.
Usage
BlurContainer
A generic wrapper aroundexpo-blur’s BlurView that fills its parent with a backdrop blur effect. Unlike GlassCard, BlurContainer adds no border or shadow — it is a pure blur layer for composing overlays, transparent headers, or full-screen loading backdrops.
Props
Blur intensity (0–100). Defaults to
EFFECTS.blurIntensity.Color tint applied to the blur layer.
dark adds a slight dark overlay; light adds a slight white overlay; default is neutral.When
false (the default), COLORS.glassBgDark is applied as a base background beneath the blur. Set to true to strip the base fill for fully transparent composition.Styles applied to the outer container
View.Usage
PanicButton
The SOS emergency button, rendered as a fixed floating circle in the bottom-left corner of the screen (zIndex: Z_INDEX.panicButton = 50). It features three concentric sonar-pulse rings that animate continuously using withRepeat + withTiming in Reanimated, each offset by 500 ms to create a staggered wave effect. Activation requires the user to hold the button for ANIMATION.panicHoldDuration (2 000 ms) using a Gesture.LongPress gesture — this prevents accidental triggers during normal app usage.
Props
Callback fired after the 2-second hold completes successfully. Use this to dispatch the emergency API call and notify contacts.
When
true, the button background transitions to COLORS.dangerLight and the icon switches from alert-outline to alert to confirm the SOS has been triggered.When
true, the long-press gesture is disabled entirely.Pulse animation
Three rings (ring1, ring2, ring3) each start at scale: 1, opacity: 0.5 and animate to scale: 2.5, opacity: 0 over 1 500 ms with staggered delays of 0, 500, and 1 000 ms respectively. The animation loops infinitely. On unmount, all animations are cancelled and shared values are reset to their initial state.
LoadingSpinner
An animated loading indicator that combines a continuous 360° rotation with a gentle scale pulse, both driven byreact-native-reanimated. Rotation completes every 1 200 ms using Easing.linear; the pulse scales between 1.0 and 1.1 every 800 ms with reversal. Optionally renders over a full-screen dark overlay.
Props
Diameter of the spinner circle in dp.
Color of the active arc on the spinner ring. Defaults to the brand teal
#14B8A6.Optional loading message displayed below the spinner in
COLORS.glassTextMutedDark.When
true, the spinner is rendered inside a full-screen View with backgroundColor: 'rgba(11, 15, 25, 0.7)' and zIndex: 100. Use this for blocking full-screen loading states.Usage
Map
TheMap component wraps react-native-maps’s MapView and re-exports Marker, PROVIDER_GOOGLE, and the Region type. The native variant (Map.tsx) uses Google Maps as the tile provider. The web variant (Map.web.tsx) renders a placeholder View with a fallback message, since react-native-maps is not supported in the web preview environment.
Metro’s platform extension resolution (Map.web.tsx takes precedence over Map.tsx on web) means you can import from the same path on all platforms without any conditional logic.
Re-exports from Map.tsx
Usage with driver markers
AppTabLayout
A shared tab-bar layout component used by both the passenger and driver app shells. It abstracts the commonexpo-router <Tabs> configuration — BlurView tab bar background, styling constants, and inactive/active tint colors — and accepts only the values that differ between the two shells: the active color and the list of tab definitions. This prevents duplicating screen options across (pasajero)/_layout.tsx and (conductor)/_layout.tsx.
AppTabLayout is not included in the barrel export because it is a layout component consumed directly by expo-router layout files, not by individual screens. Import it with a direct path:
Types
Props
Array of tab definitions. Each entry maps to a
<Tabs.Screen> with a name, title, and Ionicons icon. Order determines the left-to-right tab rendering order.Color applied to the active tab icon and label. Use
COLORS.primary (#0D9488) for the passenger shell and COLORS.success (#10B981) for the driver shell to visually distinguish the two modes.Usage
Exports
The full barrel export fromsrc/components/index.ts:
Map and AppTabLayout are not included in the barrel export. Map is a default export — import it directly: import MapView, { Marker, Region } from '@/components/Map'. AppTabLayout is a layout-layer component imported directly by expo-router layout files: import { AppTabLayout } from '@/components/AppTabLayout'. The web fallback (Map.web.tsx) is resolved automatically by Metro — no manual platform branching required.