# 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](/)
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](/)
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](/)
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](/)
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](/)
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`
###
[](#basic-usage-with-size)
Basic usage with `size`
###
[](#basic-usage-with-custom-classes)
Basic usage with custom classes
[Avatar](/avatar)
[Badge](/badge)
On this page
* [Overview](#overview)
* [Preview](#preview)
* [Installation](#installation)
* [Properties](#properties)
* [Usage](#usage)
* [Basic usage with variant](#basic-usage-with-variant)
* [Basic usage with size](#basic-usage-with-size)
* [Basic usage with custom classes](#basic-usage-with-custom-classes)
---
# Dialog - nativecn-ui
[nativecn-ui home page](/)
Search...
Search...
Navigation
[](#overview)
Overview
--------------------------
`Dialog` component in React Native is designed to manage modal dialogs within your application. The component is split into three key parts: `Dialog`, which acts as the context provider; `DialogTrigger`, which handles the action to open the dialog; and `DialogContent`, which contains the actual content to be displayed in the dialog.
[](#preview)
Preview
------------------------
* Preview
* Code
Light mode
Dark mode
[](#installation)
Installation
----------------------------------
* CLI
* Manual
npx nativecn-ui add Dialog
[](#properties)
Properties
------------------------------
###
[](#dialog)
`Dialog`
This component doesn’t accept any props directly but acts as a context provider for dialog visibility.
###
[](#dialogtrigger)
`DialogTrigger`
* `children`: The React element that will trigger the dialog to open. It should be a component that accepts an `onPress` prop, like a button.
###
[](#dialogcontent)
`DialogContent`
* `children`: The content that will be displayed inside the dialog. This can be any React Node.
[](#usage)
Usage
--------------------
To use the Dialog component, wrap your entire dialog structure with `Dialog`. Then, use `DialogTrigger` to specify the element that will open the dialog, and `DialogContent` to define the content of the dialog.
[Checkbox](/checkbox)
[Drop down](/drop-down)
On this page
* [Overview](#overview)
* [Preview](#preview)
* [Installation](#installation)
* [Properties](#properties)
* [Dialog](#dialog)
* [DialogTrigger](#dialogtrigger)
* [DialogContent](#dialogcontent)
* [Usage](#usage)
---
# Checkbox - nativecn-ui
[nativecn-ui home page](/)
Search...
Search...
Navigation
[](#overview)
Overview
--------------------------
`Checkbox` is a React Native component designed for creating interactive checkboxes with customizable styles. This component allows for easy integration into forms and user interfaces, offering properties for label display and style customization. It leverages Tailwind CSS classes to provide a flexible styling approach suitable for both light and dark themes.
[](#preview)
Preview
------------------------
* Preview
* Code
Light mode (Enabled)
Dark mode (Enabled)
Light mode (Disabled)
Dark mode (Disabled)
[](#installation)
Installation
----------------------------------
* CLI
* Manual
npx nativecn-ui add Checkbox
[](#properties)
Properties
------------------------------
* `label?: string` (optional) - The label text displayed next to the checkbox.
* `labelClasses?: string` (optional) - Custom classes for styling the label.
* `checkboxClasses?: string` (optional) - Custom classes for styling the checkbox.
* `className?: string` (optional) - Custom classes for the container wrapping the checkbox and its label.
[](#usage)
Usage
--------------------
[Card](/card)
[Dialog](/dialog)
On this page
* [Overview](#overview)
* [Preview](#preview)
* [Installation](#installation)
* [Properties](#properties)
* [Usage](#usage)
---
# Drop down - nativecn-ui
[nativecn-ui home page](/)
Search...
Search...
Navigation
[](#overview)
Overview
--------------------------
`DropDown` component in React Native is designed to manage drop-downs within your application. The component is split into 6 key parts: `DropDown`, which acts as the context provider containing the other 5 parts; `DropDownTrigger`, handles the action to open and close the dropdown; `DropDownLabel`, this is used to label a section in the dropdown menu; `DropDownContent`, this contains the actual content to be displayed in the dropdown menu; `DropDownItemSeparator` the separator is used to visually separate items in the dropdown menu; `DropDownItem` this component contains the dropdown item to be displayed in the dropdown menu.
[](#preview)
Preview
------------------------
* Preview
* Code
Light mode
Dark mode
[](#installation)
Installation
----------------------------------
* CLI
* Manual
npx nativecn-ui add DropDown
[](#components)
Components
------------------------------
###
[](#dropdown)
DropDown
This component is the parent container for the dropdown system.
* `children` - These are the components to be rendered inside the DropDown view. Mainly `DropDownTrigger`, `DropDownLabel`, `DropDownContent`, `DropDownItemSeparator` and `DropDownItem`.
###
[](#dropdowntrigger)
DropDownTrigger
This component handles the action to open and close the dropdown.
* `children`: The react element that will trigger the dialog to open. It should be a component that accepts an `onPress` prop like a button.
###
[](#dropdowncontent)
DropDownContent
This is the body of the DropDown Menu.
* `children` - Components to be rendered inside the `View` element.
* `className?: string` - Tailwind CSS classes to be applied to the `View`
###
[](#dropdownlabel)
DropDownLabel
This component accepts the `labelTitle` prop that contains the name/title as the main text shown in the header.
* `labelTitle` - Text to be rendered inside the `DropDownLabel`.
###
[](#dropdownitemseparator)
DropDownItemSeparator
This is a line approximately to the hairLineWidth that will be used to separate different sections in the dropdown menu
###
[](#dropdownitem)
DropDownItem
This component contains the item content that will be added to the dropdown menu.
* `children` - Components to be rendered inside the `View` element.
* `className?: string` - Tailwind CSS classes to be applied to the `View`
[](#usage)
Usage
--------------------
###
[](#basic-usage)
Basic Usage
To use the DropDown component, wrap your entire dropdown structure with `DropDown`. Then, use `DropDownTrigger` to specify the element that will open the dropdown, and the `DropDownContent` will now appear when you press on the `DropDownTrigger`. The `DropDownContent` will contain the content of the dropdown ie. `DropDownLabel`, `DropDownItem` and `DropDownItemSeparator`.
import {
DropDown,
DropDownContent,
DropDownItem,
DropDownItemSeparator,
DropDownLabel,
DropDownTrigger,
} from './components/DropDown';
ProfileSettingsBillingBilling
[Dialog](/dialog)
[Input](/input)
On this page
* [Overview](#overview)
* [Preview](#preview)
* [Installation](#installation)
* [Components](#components)
* [DropDown](#dropdown)
* [DropDownTrigger](#dropdowntrigger)
* [DropDownContent](#dropdowncontent)
* [DropDownLabel](#dropdownlabel)
* [DropDownItemSeparator](#dropdownitemseparator)
* [DropDownItem](#dropdownitem)
* [Usage](#usage)
* [Basic Usage](#basic-usage)
---
# Input - nativecn-ui
[nativecn-ui home page](/)
Search...
Search...
Navigation
[](#overview)
Overview
--------------------------
`Input` is a React Native component for creating text input fields with customizable styles and behaviors. It’s built on top of React Native’s [TextInput](https://reactnative.dev/docs/textinput)
. This component provides properties for label display and customization.
[](#preview)
Preview
------------------------
* Preview
* Code
Light mode
Dark mode
[](#installation)
Installation
----------------------------------
* CLI
* Manual
npx nativecn-ui add Input
[](#properties)
Properties
------------------------------
* `className?: string (optional)` - The classes for the `View` container wrapping the input field and the label.
* `label?: string` (optional) - The label text for the input field.
* `inputClasses?: string` (optional) - Custom classes for styling the input field.
* `labelClasses?: string` (optional) - Custom classes for styling the label.
* See React Native’s [TextInput props](https://reactnative.dev/docs/textinput#props)
[](#usage)
Usage
--------------------
###
[](#basic-usage-with-label)
Basic usage with `label`
###
[](#usage-with-keyboard-type-and-custom-styles)
Usage with keyboard type and custom styles
###
[](#controlled-component)
Controlled Component
const [inputValue, setInputValue] = useState('');
// ...
;
[Drop down](/drop-down)
[Progress](/progress)
On this page
* [Overview](#overview)
* [Preview](#preview)
* [Installation](#installation)
* [Properties](#properties)
* [Usage](#usage)
* [Basic usage with label](#basic-usage-with-label)
* [Usage with keyboard type and custom styles](#usage-with-keyboard-type-and-custom-styles)
* [Controlled Component](#controlled-component)
---
# Progress - nativecn-ui
[nativecn-ui home page](/)
Search...
Search...
Navigation
[](#overview)
Overview
--------------------------
`Progress` Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
[](#preview)
Preview
------------------------
* Preview
* Code
Light mode
Dark mode
[](#installation)
Installation
----------------------------------
* CLI
* Manual
npx nativecn-ui add Progress
[](#properties)
Properties
------------------------------
* `className?: string` (optional) - The classes for the `View` bar.
* `value: number` - The value of the progress bar. It should be a number between 0 and 100.
[](#usage)
Usage
--------------------
[Input](/input)
[Radio group](/radio-group)
On this page
* [Overview](#overview)
* [Preview](#preview)
* [Installation](#installation)
* [Properties](#properties)
* [Usage](#usage)
---
# Card - nativecn-ui
[nativecn-ui home page](/)
Search...
Search...
Navigation
[](#overview)
Overview
--------------------------
`Card` is a versatile React Native component that provides a structured format for displaying content. Cards can display title, description, content, and footer. It also adapts automatically to the current color scheme.
[](#preview)
Preview
------------------------
* Preview
* Code
Light mode
Dark mode
[](#installation)
Installation
----------------------------------
* CLI
* Manual
npx nativecn-ui add Card
[](#components)
Components
------------------------------
###
[](#card)
Card
The parent container for the card system.
* `children` - Components to be rendered inside the Cards container. Mainly `CardHeader`, `CardContent`, and `CardFooter`.
* `className?: string` - Tailwind CSS classes to be applied to the `View`.
###
[](#cardheader)
CardHeader
The container for the card header.
* `children` - Components to be rendered inside the Cards container. Mainly `CardTitle` and `CardDescription`.
* `className?: string` - Tailwind CSS classes to be applied to the `View`.
###
[](#cardtitle)
CardTitle
The main text shown in the header.
* `children` - Text to be rendered inside the `Text` element.
* `className?: string` - Tailwind CSS classes to be applied to the `Text`.
###
[](#carddescription)
CardDescription
The secondary text shown in the header.
* `children` - Text to be rendered inside the `Text` element.
* `className?: string` - Tailwind CSS classes to be applied to the `Text`.
###
[](#cardcontent)
CardContent
The body of the card.
* `children` - Components to be rendered inside the `View` element.
* `className?: string` - Tailwind CSS classes to be applied to the `View`.
###
[](#cardfooter)
CardFooter
The footer of the card.
* `children` - Components to be rendered inside the `View` element.
* `className?: string` - Tailwind CSS classes to be applied to the `View`.
###
[](#simplecard)
SimpleCard
A pre-built `Card` component taking text as input.
* `className?: string` - Tailwind CSS classes to be applied to the `View`.
* `title?: string` - The title of the card.
* `description?: string` - A brief description or subtitle.
* `content?: string` - The main content inside the card.
* `footer?: string` - Text to display at the bottom of the card.
[](#usage)
Usage
--------------------
###
[](#basic-usage)
Basic usage
Accelerate UIEnter a new development experience
Sleek, easy to use components to build your next app faster.
Inspired by shadcn/ui
###
[](#basic-usage-with-simplecard-component)
Basic usage with `SimpleCard` component
[Badge](/badge)
[Checkbox](/checkbox)
On this page
* [Overview](#overview)
* [Preview](#preview)
* [Installation](#installation)
* [Components](#components)
* [Card](#card)
* [CardHeader](#cardheader)
* [CardTitle](#cardtitle)
* [CardDescription](#carddescription)
* [CardContent](#cardcontent)
* [CardFooter](#cardfooter)
* [SimpleCard](#simplecard)
* [Usage](#usage)
* [Basic usage](#basic-usage)
* [Basic usage with SimpleCard component](#basic-usage-with-simplecard-component)
---
# Skeleton - nativecn-ui
[nativecn-ui home page](/)
Search...
Search...
Navigation
[](#overview)
Overview
--------------------------
`Skeleton` is a React Native component that serves as a placeholder for content during the loading state, providing a smooth, pulsating animation similar to TailwindCSS’s animate-pulse.
[](#preview)
Preview
------------------------
* Preview
* Code
Light mode
Dark mode
[](#installation)
Installation
----------------------------------
* CLI
* Manual
npx nativecn-ui add Skeleton
[](#properties)
Properties
------------------------------
* `className?: string` (optional) - The classes for the `View` container.
[](#usage)
Usage
--------------------
[Radio group](/radio-group)
[Switch](/switch)
On this page
* [Overview](#overview)
* [Preview](#preview)
* [Installation](#installation)
* [Properties](#properties)
* [Usage](#usage)
---
# Switch - nativecn-ui
[nativecn-ui home page](/)
Search...
Search...
Navigation
[](#overview)
Overview
--------------------------
`Switch` is a React Native component designed for creating a switch or toggle control. It’s built on top of React Native’s [Switch](https://reactnative.dev/docs/switch)
. It can be customized with Tailwind classes through the `className` prop.
[](#preview)
Preview
------------------------
* Preview
* Code
Light mode
Dark mode
[](#installation)
Installation
----------------------------------
* CLI
* Manual
npx nativecn-ui add Switch
[](#properties)
Properties
------------------------------
* `className?: string (optional)` - The classes for the switch.
* See React Native’s [Switch props](https://reactnative.dev/docs/switch#props)
[](#usage)
Usage
--------------------
###
[](#basic-usage)
Basic Usage
Here’s how you can use the `Switch` component:
const [isEnabled, setIsEnabled] = useState(false);
return ;
[Skeleton](/skeleton)
[Tabs](/tabs)
On this page
* [Overview](#overview)
* [Preview](#preview)
* [Installation](#installation)
* [Properties](#properties)
* [Usage](#usage)
* [Basic Usage](#basic-usage)
---
# Select - nativecn-ui
[nativecn-ui home page](/)
Search...
Search...
Navigation
[](#overview)
Overview
--------------------------
`Select` is a customizable React Native component for selecting options from a dropdown. This component converts any array of objects into an array of options compatible with the `label` and `value` fields, facilitating use with different data sources.
[](#preview)
Preview
------------------------
* Preview
* Code
Light mode
Dark mode
[](#installation)
Installation
----------------------------------
* CLI
* Manual
npx nativecn-ui add Select
[](#properties)
Properties
------------------------------
* `label?: string` (optional) - Text displayed as selector label.
* `labelClasses?: string` (optional) - Style classes for the label.
* `selectClasses?: string` (optional) - Style classes for the selector button.
* `options: any[]` (required) - Array of options that will be converted into options compatible with `label` and `value`.
* `onSelect: (value: string | number) => void` (required) - Callback function called when an option is selected.
* `selectedValue?: string | number` (optional) - Currently selected value.
* `placeholder?: string` (optional) - Placeholder to display when nothing is selected (default: ‘Select an option’).
* `labelKey: string` (required) - Label key in the options object.
* `valueKey: string` (required) - Value key in the options object.
[](#usage)
Usage
--------------------
###
[](#basic-usage-with-label)
Basic usage with `label`