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.

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
value?
number
-
increment?
number
1
emptyLabel?
string
'0'

Dependencies

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

On this page