Back to Tamagui

Spinner

code/tamagui.dev/data/docs/components/spinner/2.0.0.mdx

1.144.41.1 KB
Original Source
<HeroContainer> <SpinnerDemo /> </HeroContainer>
tsx

<Highlights features={[ 'Custom size "small" or "large".', 'Accepts all theme colors.', 'Accepts all YStack props.', ]} />

Installation

Spinner is already installed in tamagui, or you can install it independently:

bash
npm install @tamagui/spinner

Note that due to the fact that Spinner is an extension of React Native ActivityIndicator, and that only accepts size small or large, we are currently limited to just these sizes.

Usage

tsx
import { Button, Spinner } from 'tamagui'

export default () => <Spinner size="large" color="$green10" />

API Reference

Spinner

Spinner extends YStack, getting Tamagui standard props, plus:

<PropsTable data={[ { name: 'size', required: false, type: '"small" | "large"', description: Size of the spinner., }, { name: 'color', required: false, type: 'string | ColorTokens', description: Gives the spinner a color., }, ]} />