ta-01.mp4
This component is created on top of the Mantine library.
The TextAnimate
component allows you to animate text with various effects.
Additionally, it provides other sub components such as TextAnimate.TextTicker
, TextAnimate.Typewriter
, TextAnimate.NumberTicker
, and TextAnimate.Spinner
.
You can also use three useful hooks: useTextTicker
, useTypewriter
, and useNumberTicker
.
π You can find more components on the Mantine Extensions Hub library.
npm install @gfazioli/mantine-text-animate
or
yarn add @gfazioli/mantine-text-animate
After installation import package styles at the root of your application:
import '@gfazioli/mantine-text-animate/styles.css';
import { TextAnimate } from '@gfazioli/mantine-text-animate';
function Demo() {
return (
<TextAnimate animate="in" animation="slideUp" by="character">
Mantine TextAnimate component
</TextAnimate>
);
}
ta-02.mp4
import { TextAnimate } from '@gfazioli/mantine-text-animate';
function Demo() {
return (
<TextAnimate.Typewriter value="Hello, World! Mantine Typewriter component" animate />
);
}
import { useTypewriter } from '@gfazioli/mantine-text-animate'
function Demo() {
const { text, start, stop, reset, isTyping } = useTypewriter({
value: ['Hello', 'From', 'Mantine useTypewriter() hook'],
});
return (
<div>{text}</div>
);
}
ta-03.mp4
import { TextAnimate } from '@gfazioli/mantine-text-animate';
function Demo() {
return (
<TextAnimate.Spinner>β
SPINNING TEXT EXAMPLE β
</TextAnimate.Spinner>
);
}
ta-04.mp4
import { TextAnimate } from '@gfazioli/mantine-text-animate';
function Demo() {
return (
<TextAnimate.NumberTicker value={100} animate />
);
}
import { useNumberTicker } from '@gfazioli/mantine-text-animate'
function Demo() {
const { text, isAnimating, start, stop, reset, displayValue } = useNumberTicker({
value: 64,
startValue: 0,
delay: 0,
decimalPlaces: 0,
speed: 0.2,
easing: 'ease-out',
animate: true,
});
return (
<div>{text}</div>
);
}
ta-05.mp4
import { TextAnimate } from '@gfazioli/mantine-text-animate';
function Demo() {
return (
<TextAnimate.TextTicker value="Hello, World! Mantine TextTicker component" animate />
);
}
import { useTextTicker } from '@gfazioli/mantine-text-animate'
function Demo() {
const { text, isAnimating, start, stop, reset } = useTextTicker({
value: 'Mantine useTextTicker',
delay: 0,
speed: 0.2,
easing: 'ease-out',
animate: true,
});
return (
<div>{text}</div>
);
}