# Table of Contents - [Introduction - nativecn-ui](#introduction-nativecn-ui) - [Avatar - nativecn-ui](#avatar-nativecn-ui) - [Dark mode - nativecn-ui](#dark-mode-nativecn-ui) - [Badge - nativecn-ui](#badge-nativecn-ui) - [Button - nativecn-ui](#button-nativecn-ui) - [Dialog - nativecn-ui](#dialog-nativecn-ui) - [Checkbox - nativecn-ui](#checkbox-nativecn-ui) - [Drop down - nativecn-ui](#drop-down-nativecn-ui) - [Input - nativecn-ui](#input-nativecn-ui) - [Progress - nativecn-ui](#progress-nativecn-ui) - [Card - nativecn-ui](#card-nativecn-ui) - [Skeleton - nativecn-ui](#skeleton-nativecn-ui) - [Switch - nativecn-ui](#switch-nativecn-ui) - [Select - nativecn-ui](#select-nativecn-ui) - [Radio group - nativecn-ui](#radio-group-nativecn-ui) - [Tabs - nativecn-ui](#tabs-nativecn-ui) - [Toast - nativecn-ui](#toast-nativecn-ui) --- # Introduction - nativecn-ui [nativecn-ui home page![light logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-light.png)![dark logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-dark.png)](/) Search... Search... Navigation Getting Started Introduction A project inspired by [shadcn/ui](https://ui.shadcn.com/) . [​](#why-nativecn-ui) Why Nativecn UI? ----------------------------------------- * **Beautifully Designed**: Components are designed with a focus on aesthetics, delivering a great UI/UX. * **Customizable**: Modify components easily using Tailwind CSS classes —no `style` needed. * **Easy Integration**: Import components into your project as needed. No package installs. * **TypeScript-first**: Static typing for all components. [​](#installation) Installation ---------------------------------- 1 Create a new Expo project npx create-expo-app -t expo-template-blank-typescript 2 Set up \[NativeWind\](https://www.nativewind.dev/quick-starts/expo) NativeWind allows you to style components using Tailwind CSS classes. # Install dependencies yarn add nativewind@^4.0.1 react-native-reanimated yarn add --dev tailwindcss # Create a tailwind.config.js file npx tailwindcss init Finally, add `"nativewind/babel"` to your `babel.config.js` file. 3 3\. Add nativecn-ui components Run the CLI to initialize your project and add components easily: npx nativecn-ui init npx nativecn-ui add Button Or simply copy-paste from the [components directory](https://github.com/Mobilecn-UI/nativecn-ui/tree/main/components) . [​](#examples) Examples -------------------------- | Light mode | Dark mode | | --- | --- | | | | [​](#community-and-contributions) Community and Contributions ---------------------------------------------------------------- Feel free to open PRs or report issues on our [GitHub repository](https://github.com/Mobilecn-UI/nativecn-ui) . [Dark mode](/dark-mode) On this page * [Why Nativecn UI?](#why-nativecn-ui) * [Installation](#installation) * [Examples](#examples) * [Community and Contributions](#community-and-contributions) --- # Avatar - nativecn-ui [nativecn-ui home page![light logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-light.png)![dark logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-dark.png)](/) Search... Search... Navigation [​](#overview) Overview -------------------------- `Avatar` is a React Native component designed for displaying user avatars. It can show an image avatar from a given source. If the image fails to load, a fallback text can be displayed. [​](#preview) Preview ------------------------ * Preview * Code Light Mode Dark Mode [​](#installation) Installation ---------------------------------- * CLI * Manual npx nativecn-ui add Avatar [​](#usage) Usage -------------------- ### [​](#basic-usage) Basic usage CG ### [​](#custom-fallback-style) Custom fallback style SS [Dark mode](/dark-mode) [Button](/button) On this page * [Overview](#overview) * [Preview](#preview) * [Installation](#installation) * [Usage](#usage) * [Basic usage](#basic-usage) * [Custom fallback style](#custom-fallback-style) --- # Dark mode - nativecn-ui [nativecn-ui home page![light logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-light.png)![dark logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-dark.png)](/) Search... Search... Navigation Getting Started Dark mode 1 Set up dark mode module.exports = { darkMode: "class", // ... }; 2 Add a mode toggle Place a mode toggle on your app to toggle between light and dark mode. import { colorScheme, useColorScheme } from "nativewind"; export function ModeToggle() { const { colorScheme, setColorScheme } = useColorScheme(); return ( ) } Reference: [NativeWind docs](https://www.nativewind.dev/v4/core-concepts/dark-mode#manual-color-scheme-control) [Introduction](/introduction) [Avatar](/avatar) --- # Badge - nativecn-ui [nativecn-ui home page![light logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-light.png)![dark logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-dark.png)](/) Search... Search... Navigation [​](#overview) Overview -------------------------- `Badge` is a React Native component for displaying brief labels or tags with optional variants. If you want to control style using Tailwind CSS classes, use the `className` and `labelClasses` props. * Preview * Code Light mode Dark mode [​](#installation) Installation ---------------------------------- * CLI * Manual npx nativecn-ui add Badge [​](#properties) Properties ------------------------------ * `label: string` (required) - The text displayed inside the badge. * `labelClasses?: string (optional)` - The classes for the label’s text. * `className?: string (optional)` - The classes for the parent container. * `variant?: Variant` (optional) - The variant of the badge. Can be one of ‘default’, ‘secondary’, ‘destructive’, or ‘success’. [​](#usage) Usage -------------------- ### [​](#basic-usage-with-variant) Basic usage with `variant` ### [​](#basic-usage-with-custom-classes) Basic usage with custom classes [Button](/button) [Card](/card) On this page * [Overview](#overview) * [Installation](#installation) * [Properties](#properties) * [Usage](#usage) * [Basic usage with variant](#basic-usage-with-variant) * [Basic usage with custom classes](#basic-usage-with-custom-classes) --- # Button - nativecn-ui [nativecn-ui home page![light logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-light.png)![dark logo](https://mintlify.s3-us-west-1.amazonaws.com/nativecn/logo/logo-dark.png)](/) Search... Search... Navigation [​](#overview) Overview -------------------------- `Button` is a React Native component designed for creating styled buttons. It provides quick style customization through the `variant` and `size` props, automatically adapting to the device’s current color scheme. Control style using Tailwind CSS classes through the `className` and `labelClasses` props. [​](#preview) Preview ------------------------ * Preview * Code Light mode Dark mode [​](#installation) Installation ---------------------------------- * CLI * Manual npx nativecn-ui add Button [​](#properties) Properties ------------------------------ * `label: string` (required) - The label displayed on the button. * `labelClasses?: string (optional)` - The classes for the button’s text. * `className?: string (optional)` - The classes for the parent container. * `variant?: Variant` (optional) - The variant of the button. Can be one of ‘default’, ‘secondary’, ‘ghost’, ‘destructive’, or ‘link’. * `size?: Variant` (optional) - The size of the button. Can be one of ‘default’, ‘sm’, or ‘lg’. > **Note**: The `variant` property determines the background color of the button. The color scheme (light/dark mode) is automatically detected. [​](#usage) Usage -------------------- ### [​](#basic-usage-with-variant) Basic usage with `variant`