Class Names Utility
Utility function for conditionally merging class names with clsx and tailwind-merge (NativeWind) or flattening style objects (StyleSheet).
v0.1.0NativeWindStyleSheetiOSAndroidExpo GoWeb
Installation
npx nativra-cli add cnWrites the files to lib/utils, rewrites imports to your aliases and records hashes in nativra.lock.json. Existing files are never overwritten without asking.
Source
Exactly what the CLI writes, before your import aliases are applied.
Dependencies
npm packages
- clsx^2.1.1
- tailwind-merge^2.5.4
Used by
- Auth FlowTemplateA complete mobile authentication template with Sign In, Sign Up, Forgot Password, and OTP verification steps.
- Bottom SheetComponentAn interactive modal bottom drawer with drag handle and backdrop dismiss.
- Floating Action ButtonComponentAn elevated circular action button anchored above screen content.
- Icon ButtonComponentAn accessible, compact icon-only button with 44x44pt minimum touch target.
- Onboarding FlowTemplateA multi-step walkthrough walkthrough template with slides, pagination indicators, next/skip controls, and completion actions.
- OTP InputComponentA discrete multi-cell numeric pin input for one-time passwords and verification codes.
- Safe AreaComponentCross-platform viewport safe area container respecting notch and navigation bar insets.
- Settings FlowTemplateA comprehensive mobile settings screen template with account profile header, preference toggles, security options, and logout dialog.
- StackComponentFlexible layout primitives (VStack, HStack, ZStack) for composable spacing and alignment.