copy-button
Builds Avatar Badge Button Card Checkbox CommandPalette ContextMenu CopyButton DescriptionList Divider EmptyState GradientSpinner HoverCard Icon List Menu Menubar Popover ProgressBar PulseLoader Skeleton Tag Timeline


The code that drew it
A still frame holds a repeating animation at its first frame and a one-shot at its last, because a still of a moving thing is not reproducible. Run the gallery to review motion.
fn copy_button(window: &mut Window, cx: &mut App) -> AnyElement {
ensure_ordinary(window, cx);
let scene = cx.global::<SceneOrdinary>();
let idle = scene.copy_idle.clone();
let copied = scene.copy.clone();
let refused = scene.copy_refused.clone();
let theme = cx.theme().clone();
stack(&theme)
.child(caption(&theme, "Nobody has pressed it yet"))
.child(idle)
.child(caption(&theme, "The clipboard took it"))
.child(copied)
.child(caption(&theme, "It did not go through, and says so"))
.child(refused)
.into_any_element()
}