Expand description
Dioxus port of the react-type-animation typewriter component.
The main entry point is TypeAnimation. It mirrors the React library’s
feature set with Dioxus-friendly Rust types: a sequence of text, delays, and
callbacks; configurable speed/deletion speed; finite or infinite repetition;
wrapper element selection; optional cursor CSS; and custom text splitting.
§Example
use dioxus::prelude::*;
use dioxus_type_animation::{Repeat, SequenceElement, Speed, TypeAnimation};
fn App() -> Element {
rsx! {
TypeAnimation {
sequence: vec![
SequenceElement::from("We produce food for Mice"),
SequenceElement::from(1000_u64),
SequenceElement::from("We produce food for Hamsters"),
SequenceElement::from(1000_u64),
],
speed: Speed::Preset(50),
repeat: Repeat::Infinite,
style: Some("font-size: 2em; display: inline-block;".to_string()),
}
}
}Structs§
- Type
Animation Props - Props for
TypeAnimation.
Enums§
- Repeat
- Repeat behavior for an animation sequence.
- Sequence
Element - A single animation sequence item.
- Speed
- Speed configuration equivalent to the React library’s
speedanddeletionSpeedprops. - Wrapper
- HTML wrapper element used by
TypeAnimation.
Constants§
- CURSOR_
CSS - CSS used by
TypeAnimationwhencursoris enabled.
Functions§
- Type
Animation - Dioxus typewriter animation component inspired by
react-type-animation.
Type Aliases§
- Sequence
Callback - Callback entry in an animation sequence.
- String
Splitter - Function used to split a string into editable units.