Stars
A set of animated stars.
Set of stars​
| Name | Type | Description |
|---|---|---|
| theme? | string[] | An array of colors used to add theming to the animation. Fiesta theme is used by default. |
| spacing? | number | Space between items horizontally (default is 30). |
import { StyleSheet, View } from 'react-native';
import { Stars } from 'react-native-fiesta';
function App() {
return (
<View style={styles.container}>
<Stars />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
Single star​
You can also use a single star. Notice that you need to wrap the star with a Canvas, not doing this will crash the application since we need to run the animation inside a Canvas.
| Name | Type | Description |
|---|---|---|
| x | number | Initial x position of the star. |
| y | number | Initial y position of the star. |
| autoplay? | boolean | Whether the star should animate automatically or not (default is true). |
| color? | boolean | Star color (default is rgba(255, 255, 0, 1)). |
import { StyleSheet } from 'react-native';
import { Canvas } from '@shopify/react-native-skia';
import { Star } from 'react-native-fiesta';
function App() {
return (
<Canvas style={styles.canvas}>
<Star />
</Canvas>
);
}
const styles = StyleSheet.create({
canvas: {
flex: 1,
},
});