Icon Button
An accessible, compact icon-only button with 44x44pt minimum touch target.
v0.2.1NativeWindStyleSheetiOSAndroidExpo GoWeb
Preview
Installation
npx nativra-cli add icon-buttonWrites IconButton.tsx to components/ui, rewrites imports to your aliases and records hashes in nativra.lock.json, along with 2 registry dependencies. Existing files are never overwritten without asking.
Want to try it first? Open it in the playground: a real React Native project in your browser, with this item installed by the CLI.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| accessibilityLabel | string | required | Screen reader accessibility label |
| variant | "default" | "primary" | "secondary" | "destructive" | "outline" | "ghost" | "default" | Visual color and depth preset |
| size | "sm" | "md" | "lg" | "md" | Target dimensions (sm: 36pt, md: 44pt, lg: 52pt) |
| rounded | "default" | "full" | "default" | Corner radius preset |
| loading | boolean | false | Shows spinning activity indicator |
| disabled | boolean | false | Disables interaction and dims opacity |
| children | React.ReactNode | required | Icon component (e.g. from lucide-react-native) |
| onPress | () => void | undefined | Press event callback |
Source
Exactly what the CLI writes, before your import aliases are applied.
Dependencies
Registry items
- useThemeColorsHookReturns the installed theme's semantic colors for the current light/dark scheme, and the installed style's tokens and helpers. Used by every component.
- Class Names UtilityUtilityUtility function for conditionally merging class names with clsx and tailwind-merge (NativeWind) or flattening style objects (StyleSheet).
npm packages
- class-variance-authority^0.7.1