layer5io / layer5io/sistent

Refactor FlipCard to use CSS 3D Transforms and Explicit Props

Open
#1,546 1 comment 0 reactions 1 assignee View on GitHub

@Katotodan is already working on this.

Since May 13, 2026.

Dominant language
TypeScript
Stars
137
Forks
239
Avg merge
4d 14h
Merged PRs (30d)
5

Description

Context

The current FlipCard implementation relies on a JavaScript setTimeout to swap children during the animation. This causes several issues:

  • Flicker/Blanking: Content can disappear if the JS thread is busy.

  • Rigid API: Using an array for children is prone to runtime errors.

  • Theming/Sizing: Difficult to pass dynamic backgrounds or calculate container sizes because the back face is not rendered until the flip occurs.

Proposed Changes
  • Replace array-based children with explicit frontElement and backElement props.

  • Remove setTimeout logic and implement standard CSS rotateY(180deg) with backface-visibility: hidden.

  • Add flipAction prop to support both 'click' and 'hover' interactions.

  • Improve TypeScript safety by removing manual child-index checking.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.