@gfazioli/mantine-flip
A Mantine component that flips the content of the component when hovered over.
Installation
After installation import package styles at the root of your application:
You can import styles within a layer @layer mantine-flip by importing @gfazioli/mantine-flip/styles.layer.css file.
Usage
Norway Fjord Adventures
With Fjord Tours you can explore more of the magical fjord landscapes with tours and activities on and around the fjords of Norway
Edit Widget
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, voluptatum.
IMPORTANT
The
Flipcomponent must have exactly two children. The first child is the front face, and the second child is the back face.
Uncontrolled
Front Card
The front card
Back Card
Controlled
You may control the state of the card by setting the flipped prop to true or false.
This is useful when you want to control the state of the card from the parent component.
Front Card
The front card
Back Card
Initial face and Flip.Target
For controlled Flip components, you will use
useStateto determine which side of the component to initially show. Additionally, you will not need to useFlip.Targetfor buttons, but you can control them manually to keep the states synchronized.
Default Flipped (face)
You may display the initial face of the card by setting the defaultFlipped prop to true.
Front Card
The front card
Back Card
In this case the defaultFlipped prop is set to true, and the back card is visible
Direction
You can change the flip rotation direction to vertical using the direction prop.
Front Side
Click the button below to flip vertically
Back Side
Click the button below to flip back
Custom Flip Transitions
You can customize the flip transition direction using directionFlipIn and directionFlipOut props.
Custom Transitions
Flip In: Positive
Flip Out: Negative
Back Side
Notice the different rotation direction
Flip Target
You can use Flip.Target to make any element clickable to toggle the flip state. This is useful when you want to trigger the flip from a button or a specific area of the card.
This card has multiple targets
Text Target
Back Side
Styled Flip component
You can style the Flip component using the classNames prop to target specific inner elements. This allows for granular customization of the component's appearance.
Front Card
Back Card
Styles API
Flip supports Styles API, you can add styles to any inner element of the component with classNames prop. Follow Styles API documentation to learn more.
You can customize the appearance of the Flip component using the Styles API. This allows you to modify styles for various parts of the component, such as the container, front face, back face, and other inner elements.
Front Card
Back Card
Component Styles API
Hover over selectors to highlight corresponding elements
Example: Credit card
The Bank
Press ESC to flip back
Example: Signin form
Click on "Create account" to flip the card.
Welcome back!
Do not have an account yet?
Example: Profile Card
Jane Fingerlicker
Fullstack Engineer
34K
Followers
187
Following
1.9K
Posts
Contact Info
jane@fingerlicker.dev
Socials
Example: Grid Widget
Given that the Flip component behaves like a MacOS Widget, it is important to understand where and how to set the dimensions to avoid overflow issues.

Test 1
Test 1 description
Test 1
Test 1 description
Additional information about Test 1.

Test 2
Test 2 description
Test 2
Test 2 description
Additional information about Test 2.

Test 3
Test 3 description
Test 3
Test 3 description
Additional information about Test 3.

Test 4
Test 4 description
Test 4
Test 4 description
Additional information about Test 4.

Test 5
Test 5 description
Test 5
Test 5 description
Additional information about Test 5.

Test 6
Test 6 description
Test 6
Test 6 description
Additional information about Test 6.

Test 7
Test 7 description
Test 7
Test 7 description
Additional information about Test 7.

Test 8
Test 8 description
Test 8
Test 8 description
Additional information about Test 8.

Test 9
Test 9 description
Test 9
Test 9 description
Additional information about Test 9.