Skip to content

Instantly share code, notes, and snippets.

@lightsound
Created March 23, 2022 06:29
Show Gist options
  • Save lightsound/8d9471cf9dfd62fc29da1b35602fcafa to your computer and use it in GitHub Desktop.
Save lightsound/8d9471cf9dfd62fc29da1b35602fcafa to your computer and use it in GitHub Desktop.
Mantine Buttonコンポーネントの凹まない版
import type { ButtonProps } from "@mantine/core";
import { Button } from "@mantine/core";
import { cloneElement, forwardRef } from "react";
export const NoAnimatedButton = forwardRef<
HTMLButtonElement,
ButtonProps<"button">
>(({ sx, ...props }, ref) => {
return cloneElement(<Button />, {
sx: { ...sx, "&:not(:disabled):active": { transform: "none" } },
ref,
...props,
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment