Skip to Content
ComponentsOverview

Component Library

RNCopilot ships with 30 production-ready UI components organized into 8 categories. Every component is fully typed, themed with react-native-unistyles 3.x semantic tokens, and supports both light and dark modes out of the box.

All components are exported from a single barrel file. Import what you need from @/common/components:

import { Button, Text, Card, Input } from '@/common/components'; import type { ButtonProps, TextVariant } from '@/common/components';

Categories

Action — 2 components

Interactive elements that trigger actions.

ComponentDescription
ButtonPrimary action element with 4 variants, 3 sizes, loading state, and icon support
IconButtonCompact icon-only button with the same variant and size system

Data Display — 6 components

Components for presenting content and information.

ComponentDescription
TextTypography system with 8 variants, weight control, and semantic colors
AvatarUser representation with image, initials, and icon fallbacks
BadgeStatus indicators with solid, outline, and dot variants
CardContent container with filled, elevated, and outlined styles
ChipCompact selectable/dismissible tags
ListItemStructured row with title, subtitle, and slot content

Disclosure — 1 component

ComponentDescription
AccordionExpandable sections with single or multiple expand modes

Feedback — 6 components

Components that communicate status, progress, and errors.

ComponentDescription
LoadingActivity indicator with optional message and fullscreen mode
ProgressBarDeterminate and indeterminate progress with 5 color schemes
SkeletonPlaceholder loading states with text, circle, and rect shapes
SnackbarAuto-dismissing notification with action support
EmptyStatePlaceholder for empty lists or screens with optional action
ErrorBoundaryCrash recovery boundary with retry functionality

Form — 9 components

Input controls and form utilities.

ComponentDescription
InputText field with label, error, helper text, and icon slots
TextAreaMulti-line input with character count
SelectBottom sheet dropdown picker
CheckboxToggle with label and indeterminate state
SwitchOn/off toggle with label
RadioGroupSingle-select option group, vertical or horizontal
SegmentedControlAnimated tab-style selector with icon support
SearchBarSearch input with clear button and loading state
FormFieldreact-hook-form Controller wrapper for any input

Layout — 2 components

Structural components for page composition.

ComponentDescription
ScreenContainerSafe area wrapper with optional scroll and padding
DividerHorizontal or vertical separator line

Overlay — 2 components

Components that render above other content.

ComponentDescription
DialogModal dialog with title, message, and action buttons
MenuDropdown menu with icons and destructive item support

Typography — 2 components

Text rendering and iconography.

ComponentDescription
IconIonicons wrapper with 6 semantic color variants
TextFull typography system (also listed under Data Display)

File Structure Pattern

Every component follows a consistent directory structure:

ComponentName/ ├── ComponentName.tsx # Component implementation ├── ComponentName.styles.ts # Unistyles stylesheet (optional) ├── ComponentName.types.ts # TypeScript interfaces (optional) └── index.ts # Barrel export

Styles use the unistyles variants API:

import { StyleSheet } from 'react-native-unistyles'; export const styles = StyleSheet.create((theme) => ({ container: { backgroundColor: theme.colors.surface.primary, borderRadius: theme.radius.md, variants: { size: { sm: { padding: theme.spacing.sm }, md: { padding: theme.spacing.md }, lg: { padding: theme.spacing.lg }, }, }, }, }));

Interactive components use press animations via the useAnimatedPress hook for tactile feedback on touch.

Shared Types

Several types are shared across the library:

/** Semantic color scheme used across components. */ type ColorScheme = 'primary' | 'success' | 'error' | 'warning' | 'info'; /** Standard component size scale. */ type ComponentSize = 'sm' | 'md' | 'lg';
Last updated on