CardStack
Review a deck one card at a time by dragging, flicking, pressing a button or using the arrow keys, with undo.
Examples
Systems
Rust
Memory safety without a garbage collector.
fn main() {
println!("Hello");
}Decide a card to see it here.
When to use CardStack
Use when
Use CardStack for one-by-one triage: learning lists, review queues and onboarding picks, especially when a left or right decision should be undoable.
Avoid when
Avoid it when people need to compare items side by side, where a list or table fits, and for browsing without deciding, where a carousel fits. For quick actions on list rows use SwipeableList.
Accessibility
The stage is a focusable group described as a card stack, with a hint for the controls. Left and Right arrows decide the top card and Backspace, Cmd+Z or Ctrl+Z undo. The top card is labelled with its position, such as Rust, 1 of 4, and the cards beneath are hidden from assistive technology. Buttons offer every gesture, so swiping is never required, and decisions, undo and reset are announced politely. Touch swipes use touch-action pan-y, so vertical scrolling still works.