Link With Button Styles
src / Demo.tsx
123456789101112131415161718192021222324252627282930313233343536373839404142434445import React, { ReactElement } from "react";
import cn from "classnames";
import { ButtonThemeProps, buttonThemeClassNames } from "@react-md/button";
import { Link, LinkProps } from "@react-md/link";
import styles from "./WithButtonStyles.module.scss";
function LinkStyledButton({
className,
theme,
themeType,
buttonType,
disabled,
children,
...props
}: ButtonThemeProps & LinkProps): ReactElement {
return (
<Link
{...props}
className={buttonThemeClassNames({
disabled,
theme,
themeType,
buttonType,
className: cn(styles.link, className),
})}
>
{children}
</Link>
);
}
LinkStyledButton.defaultProps = {
theme: "primary",
themeType: "contained",
buttonType: "text",
};
export default function Demo(): ReactElement {
return (
<LinkStyledButton href="https://react-md.dev">
https://react-md.dev
</LinkStyledButton>
);
}