@gfazioli/mantine-flip

中文文档
4.0.22发布于 2026/11/09MITTypeScriptESM + CJS零依赖近 30 天下载 3664

Flip component is a wrapper for any component that can be flipped. It is used to create cards, flip boxes and more.

原始使用文档
文档目录4 节
  1. Overview
  2. Installation
  3. Usage
  4. Sponsor

Mantine Flip Component

Mantine Flip

mantine-flip at a glance, refreshed daily: commits, releases, stars, issues and pull requests, a year of commit activity, the weekly rhythm, languages, latest commits and releases, contributors
Made with glancecard · refreshed daily

Overview

This component is created on top of the Mantine library. It requires Mantine 9.x and React 19.

Mantine Flip is a two-face container that animates between a front and a back view, ideal for compact UIs that need progressive disclosure (e.g., editing panels, settings, sign-in/sign-up toggles, or profile details). It supports both uncontrolled usage with Flip.Target to wire any element as a click trigger, and controlled usage via flipped/defaultFlipped using React state for full synchronization with your app logic. The component enforces exactly two children, accepts size constraints (w/h), and offers transition customization such as vertical flipping and distinct rotation directions for flip-in and flip-out. Styling hooks (classNames/Styles API) let you target inner parts for design refinement, while examples demonstrate practical patterns like credit-card editing, modal-like settings panes, and multi-target triggers within a single face.

[!note]

→ Demo and Documentation → Youtube Video → More Mantine Components

Installation

npm install @gfazioli/mantine-flip

or

yarn add @gfazioli/mantine-flip

After installation import package styles at the root of your application:

import '@gfazioli/mantine-flip/styles.css';

Usage

import { Flip } from '@gfazioli/mantine-flip';

function Demo() {
  return (
    <Flip h={200} w={200}>

        <Paper radius="md" withBorder p="lg" shadow="md">
          <h3>Front Card</h3>
          <Flip.Target>
            <Button>Flip Back</Button>
          </Flip.Target>
        </Paper>

        <Paper radius="md" withBorder p="lg" shadow="md">
          <h3>Back Card</h3>
          <Flip.Target>
            <Button>Flip Front</Button>
          </Flip.Target>
        </Paper>

    </Flip>
  );
}

As you can see, the Flip component wraps two children, which are the two views that you want to flip between. The Flip.Target component is used to define the trigger for the flip animation. It can be any component, such as a button, or a link, or even a div.

Sponsor

Your support helps me:

  • Keep the project actively maintained with timely bug fixes and security updates
  • Add new features, improve performance, and refine the developer experience
  • Expand test coverage and documentation for smoother adoption
  • Ensure long‑term sustainability without relying on ad hoc free time
  • Prioritize community requests and roadmap items that matter most

Open source thrives when those who benefit can give back—even a small monthly contribution makes a real difference. Sponsorships help cover maintenance time, infrastructure, and the countless invisible tasks that keep a project healthy.

Your help truly matters.

💚 Become a sponsor today and help me keep this project reliable, up‑to‑date, and growing for everyone.


https://github.com/user-attachments/assets/cc968450-9d8c-4b16-be58-a6766597742e

版本与发布记录

@gfazioli/mantine-flip 共发布 102 个版本,首次发布于 2024/02/05;过去 12 个月发布了 44 个版本。

版本发布日期距今
4.0.22latest2026/11/096 天前
4.0.212026/11/069 天前
4.0.202026/10/2621 天前
4.0.192026/10/2224 天前
4.0.182026/10/131 个月前
4.0.172026/10/101 个月前

关于 @gfazioli/mantine-flip 的常见问题

@gfazioli/mantine-flip 是什么?

Flip component is a wrapper for any component that can be flipped. It is used to create cards, flip boxes and more.

如何安装 @gfazioli/mantine-flip?

在项目目录运行 npm install @gfazioli/mantine-flip,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.x || ^19.x)、react-dom(^18.x || ^19.x)、@mantine/core(>=9.0.0)、@mantine/hooks(>=9.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@gfazioli/mantine-flip 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gfazioli/mantine-flip 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@gfazioli/mantine-flip 可以商用吗?

@gfazioli/mantine-flip 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gfazioli/mantine-flip 的下载量有多少?

根据 npm 官方下载统计,@gfazioli/mantine-flip 在 2026/10/17 – 2026/11/15 这 30 天内被下载 3,664 次,日均约 122 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gfazioli/mantine-flip 还在维护吗?

最新版本 4.0.22 发布于 2026/11/09(6 天前);至今共发布 102 个版本,其中过去 12 个月发布了 44 个;首次发布于 2024/02/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。