AnimatedProps
animate's values: each change moves as the view's transition says.
Utilisation
Share animation targets between views.
// Share animation targets between views.
import { Pressable, Text, signal, spring, timing, type AnimatedProps } from 'kuito';
const selected = signal(false);
const look = (on: boolean): AnimatedProps => ({
opacity: on ? 1 : 0.6,
scale: on ? 1 : 0.96,
backgroundColor: on ? '#0a84ff' : '#e5e5ea',
});
<Pressable
animate={look(selected.value)}
transition={{
opacity: timing(200),
transform: spring({ damping: 14 }),
backgroundColor: timing(200),
}}
onPress={() => (selected.value = !selected.value)}
>
<Text>Follow</Text>
</Pressable>;Déclaration du type
export type AnimatedProps = Partial<Record<AnimatableProps, number | string>>;Membres 16
| Nom | Type | Requis | Description |
|---|---|---|---|
opacity | string | number | Non | — |
backgroundColor | string | number | Non | — |
borderRadius | string | number | Non | — |
borderColor | string | number | Non | — |
width | string | number | Non | — |
height | string | number | Non | — |
translateX | string | number | Non | — |
translateY | string | number | Non | — |
scale | string | number | Non | — |
scaleX | string | number | Non | — |
scaleY | string | number | Non | — |
rotate | string | number | Non | — |
shadowColor | string | number | Non | — |
shadowRadius | string | number | Non | — |
shadowOffsetX | string | number | Non | — |
shadowOffsetY | string | number | Non | — |
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.