TapRailsThemeProvider
Wrap your app root withTapRailsThemeProvider to enable theming across all TapRails components:
colorOverrides
All fields are optional — any value you omit falls back to the TapRails default:| Field | Default | Description |
|---|---|---|
primary | #8B5CF6 | Main brand color (buttons, icons, accents) |
success | #10B981 | Success states and confirmations |
error | #EF4444 | Error states |
background | #0D0D0D | Screen background |
surface | #1A1A1A | Card / elevated surface background |
text | #FFFFFF | Primary body text |
textMuted | #9CA3AF | Muted / secondary text |
border | #2D2D2D | Dividers and borders |
useTheme
Access the active theme anywhere in your component tree:theme.colors
All colors fromcolorOverrides merged with TapRails defaults, accessible as theme.colors.<key>.
theme.typography.styles
Pre-built text style objects:| Key | Usage |
|---|---|
h1 | Large screen heading |
h2 | Section heading |
h3 | Card heading |
body | Regular body text |
bodySmall | Small secondary text |
label | Input labels |
button | Button label text |
mono | Monospace (tx hashes, addresses) |
Button Component
A themed, accessible button with variants and sizes:ButtonProps
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | — | Button label |
onPress | () => void | — | Press handler |
variant | ButtonVariant | 'primary' | Visual style |
size | ButtonSize | 'md' | Height and font size |
loading | boolean | false | Shows spinner, disables press |
disabled | boolean | false | Disables interaction and dims button |
icon | ReactNode | — | Optional icon to the left of label |
style | StyleProp<ViewStyle> | — | Additional container styles |
Icon Component
Access TapRails’s icon set directly:lucide-react-native library under the hood. The name prop accepts any Lucide icon name.
IconProps
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | — | Lucide icon name (snake_case) |
size | number | 24 | Icon width and height in points |
color | string | theme.colors.text | Icon color |
strokeWidth | number | 2 | Stroke weight |
Accessibility
TapRails UI components are built WCAG AA compliant:- All interactive elements have
accessibilityLabelandaccessibilityRole - Minimum touch targets of 44×44pt
- Color contrast ratios meet WCAG AA (≥ 4.5:1 for text)
- Loading states announce to screen readers via
accessibilityLiveRegion - Full keyboard navigation support

