Animation
What a builder returns: give it to a prop, a transition or a motion value.
Utilisation
Overlay a now-playing caption
Ce type est utilisé par Blur
import { Blur, Image, Text, VStack } from 'kuito';
export default function NowPlaying() {
return (
<VStack flex={1}>
<Image
src="https://example.com/cover.jpg"
position="absolute"
top={0}
left={0}
right={0}
bottom={0}
/>
<Blur material="thin" position="absolute" bottom={0} left={0} right={0} padding={16}>
<Text>Now playing</Text>
</Blur>
</VStack>
);
}Déclaration du type
export interface Animation<T = number> {
/** Where it comes to rest; without one, the prop or transition says. */
readonly target?: T | readonly number[];
readonly __kuitoAnimation: AnimationSpec;
readonly onEnd?: AnimationCallback;
/**
* The same animation toward `target`. Several numbers are snap points: a
* release goes to the one nearest where the throw would land.
*/
to<U extends number | string>(
target: U | readonly number[],
): Animation<U extends number ? number : string>;
}Membres 3
| Nom | Type | Requis | Description |
|---|---|---|---|
targetlecture seule | T | readonly number[] | Non | Where it comes to rest; without one, the prop or transition says. |
onEndlecture seule | AnimationCallback | Non | — |
to | <U extends number | string>(target: U | readonly number[]) => Animation<U extends number ? number : string> | Oui | The same animation toward target. Several numbers are snap points: a
release goes to the one nearest where the throw would land. |
onEnd — signatures de méthode
Signatures
(finished: boolean): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
finished | boolean | Oui | — |
Retourne
void
to — signatures de méthode
Signatures
<U extends number | string>(target: U | readonly number[]): Animation<U extends number ? number : string>Paramètres de type
| Nom | Contrainte | Par défaut |
|---|---|---|
U | string | number | — |
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
target | readonly number[] | U | Oui | — |
Retourne
Animation<U extends number ? number : string>
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.