Components
The @latty-ds/react-native package ships 40+ components that mirror the web component library. All components consume the theme from LattyProvider context and adapt to the active color scheme automatically.
Prop conventions
React Native components follow the same naming patterns as their web counterparts:
| Prop | Type | Used by |
|---|---|---|
variant | Color intent: primary, secondary, success, warning, error, info, neutral | Button, Badge, Alert, Chip, Progress, Spinner, Switch, Checkbox, Radio |
appearance | Visual weight: filled, outlined, ghost, soft | Button, Badge, Alert, Chip, Accordion, Surface |
size | Dimension: sm, md, lg | Button, Textfield, Badge, Chip, Select, etc. |
disabled | Boolean — disables interaction | All interactive components |
Key differences from web
onPress instead of onClick, onValueChange instead of onChange for toggles.icon, leading, trailing).style prop for layout overrides (ViewStyle).style prop.Component catalog
Layout
| Component | Description |
|---|---|
Surface | Themed container with background, elevation, and border radius |
Divider | Horizontal or vertical separator line |
AppBar | Top navigation bar with title, actions, and back button |
Drawer | Slide-in panel from any edge of the screen |
Actions
| Component | Description |
|---|---|
Button | Primary interactive element with variants, sizes, loading state, and icons |
IconButton | Icon-only button for toolbar actions |
Link | Inline text link with underline options |
Chip | Compact label for tags, filters, or selections |
Forms
| Component | Description |
|---|---|
Textfield | Text input with label, helper text, and validation states |
Select | Single-value picker from a list of options |
Combobox | Searchable select with autocomplete |
Checkbox | Boolean toggle with label |
Switch | On/off toggle control |
Radio + RadioGroup | Single selection from a group |
Slider | Range value selector |
DatePicker | Date selection with calendar popup |
Calendar | Full month calendar view |
Data display
| Component | Description |
|---|---|
Text | Typography component with 15 variants |
Badge | Status indicator or count label |
Avatar + AvatarGroup | User photo or initials with stacking |
Table | Data table with sorting and density options |
List + ListItem + ListDivider | Structured vertical list |
LtImage | Image with loading state and fallback |
Skeleton | Placeholder shimmer for loading states |
Progress | Determinate or indeterminate progress bar |
Spinner | Loading indicator |
Feedback
| Component | Description |
|---|---|
Alert | Inline message with variant coloring and optional close |
Snackbar + SnackbarGroup | Toast notification at the bottom of the screen |
Dialog | Modal overlay for confirmations and forms |
Tooltip | Contextual hint on long press |
Navigation
| Component | Description |
|---|---|
TabGroup + Tab | Tabbed content switching |
Pagination | Page navigation controls |
Dropdown | Action menu triggered by a button or long press |
Accordion + AccordionGroup | Collapsible content panels |
Icons
| Component | Description |
|---|---|
LattyIcon | Icon renderer using the Latty icon set |
Example
A complete screen using multiple components:
import { ScrollView } from 'react-native';
import {
LattyProvider,
AppBar,
Surface,
Text,
Textfield,
Button,
Badge,
Divider,
Alert,
useLatty,
} from '@latty-ds/react-native';
function ProfileScreen() {
const { theme } = useLatty();
return (
<>
<AppBar title="Profile" />
<ScrollView
style={{ flex: 1, backgroundColor: theme.semantic.bg.base }}
contentContainerStyle={{ padding: theme.layout.screenPadding, gap: theme.spacing['4'] }}
>
<Alert variant="info">Complete your profile to unlock all features.</Alert>
<Surface elevation={1} appearance="outlined" style={{ gap: 16, padding: 16 }}>
<Text variant="h4">Personal info</Text>
<Textfield label="Full name" size="md" />
<Textfield label="Email" size="md" />
<Divider />
<Button variant="primary">Save changes</Button>
</Surface>
<Badge variant="success" appearance="soft">Profile 80% complete</Badge>
</ScrollView>
</>
);
}
export default function App() {
return (
<LattyProvider config={{ colors: { primary: '#4F46E5' } }}>
<ProfileScreen />
</LattyProvider>
);
}
TypeScript
All component props, theme types, and utilities are exported:
import type {
LattyTheme,
LattyProviderProps,
SemanticTokens,
ColorScheme,
ColorPalette,
ButtonProps,
ButtonVariant,
TextProps,
TextVariant,
TextColor,
SurfaceProps,
BadgeProps,
AlertProps,
NativeShadow,
} from '@latty-ds/react-native';