CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

ui-patterns

NativeWind design system, component patterns, and UI conventions for POSCursor

59

Quality

74%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./.agents/skills/ui-patterns/SKILL.md
SKILL.md
Quality
Evals
Security

UI Patterns Skill — POSCursor

Styling Stack

TechVersionNotes
NativeWindv4.2.2Tailwind CSS for React Native
Tailwind CSSv3.4.19Configuration in tailwind.config.js
Reanimatedv4.2.1Animations
Expo Routerv55File-based routing

Babel config disables nativewind/babel in test mode (process.env.NODE_ENV === 'test').

Color Palette

Defined in src/constants/colors.ts:

Core Colors

TokenHexUsage
primary#059669 (Emerald 600)Main brand, buttons, active states
primaryDark#047857 (Emerald 700)Pressed states
primaryLight#10B981 (Emerald 500)Highlights
secondary#1E293B (Slate 800)Navigation, dark backgrounds
secondaryDark#0F172A (Slate 900)Screen backgrounds
accent#F59E0B (Amber 500)Warnings, attention
background#F8FAFC (Slate 50)Light background
surface#FFFFFFCards, modals

Status Colors

TokenHexStatus
statusPending#64748BPending loans
statusActive#059669Active loans
statusPaid#2563EBPaid loans
statusDefaulted#DC2626Defaulted
statusRestructured#EA580CRestructured
statusPartial#D97706Partial payment
statusLate#991B1BLate payment

Role Colors

RoleColorHex
AdminRed#DC2626
CollectorEmerald#059669
Loan EncoderBlue#2563EB
Payment EncoderOrange#EA580C
Expenses EncoderViolet#7C3AED
BorrowerSlate#1E293B

Transaction Colors

TypeHex
Cash In#16A34A (Green 600)
Cash Out#DC2626 (Red 600)

Currency

Philippine Peso (₱) — formatted via src/utils/currency.ts and rendered with <PhpCurrencyText> component.

Always format monetary values with the ₱ symbol and proper thousands separators.

App Structure (Expo Router)

app/
├── _layout.tsx          # Root layout
├── index.tsx            # Entry redirect
├── login.tsx            # Login screen (16KB — complex)
├── register.tsx         # Registration
├── loading.tsx          # Loading/splash
├── sync-center.tsx      # Sync management UI
├── (admin)/             # Admin dashboard & management
│   ├── index.tsx        # Admin dashboard (39KB — largest screen)
│   ├── loans/           # Loan management
│   ├── borrowers/       # Borrower management
│   ├── collectors/      # Collector management
│   ├── payments/        # Payment management
│   ├── expenses/        # Expense tracking
│   ├── cash-on-hand/    # Cash management
│   ├── bank-accounts/   # Bank accounts
│   ├── remittances.tsx  # Remittance tracking
│   ├── reports/         # Financial reports
│   ├── settings/        # App settings
│   ├── users/           # User management
│   └── help.tsx         # Help guide
├── (collector)/         # Collector dashboard
│   ├── index.tsx        # Collector dashboard (26KB)
│   ├── collection-sheet.tsx      # Default collection sheet
│   ├── collection-sheet-daily.tsx
│   ├── collection-sheet-weekly.tsx
│   ├── borrowers/
│   ├── remittances.tsx
│   └── help.tsx
├── (borrower)/          # Borrower portal
├── (loan-encoder)/      # Loan entry screens
├── (payment-encoder)/   # Payment entry screens
└── (expenses-encoder)/  # Expense entry screens

Key Components

Located in src/components/:

ComponentPurposeKey Props
StatCardDashboard metric cardstitle, value, icon, color
CollectorKpiCardKPI display for collectorsKPI metrics
SyncStatusBadgeShows sync state (syncing/complete/error)Reads from useSyncStore
SyncStatusIndicatorDetailed sync progressProgress bar, logs
ConfirmDialogConfirmation modaltitle, message, onConfirm
ActionSheetBottom sheet actionsactions[]
AnimatedPressablePressable with scale animationWraps Pressable
ErrorBoundaryCatches React render errorsWraps children
OfflineBannerShows when device offlineAuto via useNetworkStatus
BorrowerSelectorSearchable borrower pickerReactive via WatermelonDB
SearchBarReusable search inputonSearch, placeholder
PhpCurrencyTextFormats numbers as ₱amount
LendingPerformanceChartChart for lending metricsreact-native-chart-kit
MetricInfoDialogKPI metric explanationsmetric, visible
MetricBreakdownDialogDetailed metric breakdowndata
ReportInfoModalReport metadata display-
AppLogoBrand logo SVG-
SwipeableItemSwipe-to-reveal actionsreact-native-gesture-handler
SidebarContentNavigation drawerRole-based menu items
HelpStepCardHelp guide step cardstep, title, description

Animation Patterns

Using react-native-reanimated v4:

import Animated, { FadeInUp, FadeInDown, LinearTransition } from 'react-native-reanimated';

// Entry animations
<Animated.View entering={FadeInUp.delay(100).duration(400)}>
    <StatCard ... />
</Animated.View>

// Layout animations for list reordering
<Animated.View layout={LinearTransition.springify()}>
    ...
</Animated.View>

Reactive WatermelonDB Components

Use @nozbe/with-observables HOC or observe() for reactive data binding:

import { withObservables } from '@nozbe/with-observables';
import { database } from '../database';

const enhance = withObservables([], () => ({
    borrowers: database.get('borrowers').query().observe(),
}));

export default enhance(BorrowerList);

Icons

Primary icon library: @expo/vector-icons — Ionicons

import { Ionicons } from '@expo/vector-icons';
<Ionicons name="people" size={24} color={Colors.primary} />

Role icons from src/constants/roles.ts:

  • admin → shield-checkmark
  • collector → people
  • loan_encoder → document-text
  • payment_encoder → cash
  • expenses_encoder → receipt
  • borrower → person-outline
  • main_office → business

UI Conventions

  1. Dark nav, light content: Navigation bars use secondary (#1E293B), content areas use background (#F8FAFC)
  2. Card-based layouts: All data displayed in white surface cards with subtle borders (#E2E8F0)
  3. Emerald CTAs: Primary actions always use primary emerald green
  4. Status pills: Color-coded badges for loan status, payment status, etc.
  5. Bottom toast notifications: Via react-native-toast-message with error/success/info variants
  6. Pull-to-refresh: Standard pattern for data lists
  7. Haptic feedback: Via expo-haptics for confirmations and actions
  8. No Arbitrary Hex Colors: NativeWind v4 does NOT support arbitrary hex colors (e.g. bg-[#1E3A8A]). You MUST use standard Tailwind classes (e.g. bg-blue-900) instead.
Repository

zazakia/JetFarm

Path

.agents/skills/ui-patterns/SKILL.md

Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.