Documentation Index
Fetch the complete documentation index at: https://docs.shipmobilefast.com/llms.txt
Use this file to discover all available pages before exploring further.
RainbowButton is an animated button component that features a rotating gradient border effect. It’s built with React Native Reanimated and Expo Linear Gradient, providing a visually appealing interactive element.
Installation
Ensure you have the necessary dependencies:Import
Props
| Prop | Type | Required | Description |
|---|---|---|---|
{onPress} | () => void | Yes | Function to call when button is pressed |
{style} | ViewStyle | No | Custom styles for the container |
{children} | React.ReactNode | Yes | Content to display inside the button |
{colors} | string[] | No | Array of colors for gradient (default: ['#00ff4e', '#000']) |
{duration} | number | No | Animation duration in milliseconds |
{bgColor} | string | No | Background color of the button |
{buttonStyle} | ViewStyle | No | Custom styles for the button inner container |
{height} | number | No | Height of the button |
{borderRadius} | number | No | Border radius of the button |
Usage
Basic Usage
Custom Colors and Duration
Explanation
-
{onPress}: Required callback function that executes when the button is pressed -
{colors}: Optional array of colors that define the gradient effect -
{duration}: Optional animation duration in milliseconds for one complete rotation -
{bgColor}: Optional background color of the button’s content area -
{height}: Optional custom height for the button -
{borderRadius}: Optional border radius value for rounded corners