LogoCraftReactNative
Components

Counter

A counter component that allows users to increment or decrement a value. It displays the current value and provides buttons for incrementing and decrementing.

Component preview

Installation

npx @craftreactnative/ui add Counter

Usage

Screen.tsx
import { Counter } from "@/craftrn-ui/components/Counter";
 
export const Screen = () => <Counter onValueChange={() => {}} value={0} />;

Props

PropTypeDefault
onValueChange
(value: number) => void
-
minValue?
number
0
maxValue?
number
10
initialValue?
number
0
increment?
number
1
emptyLabel?
string
'0'

Dependencies

1 packages
react-native-unistyles
Required imports
craftrn-ui/components/ButtonRound
craftrn-ui/components/Text

On this page