This commit is contained in:
Felix Klement committed 2026-09-20 12:45:33 +02:00
1 parent b244287f6a
commit 5a2d49c17f
77 files changed
+2289 -31

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import type { ReactNode } from 'react';
import { cx } from './cx';
export interface ButtonProps {
/** Renders an anchor when set, a button element otherwise. */
href?: string;
size?: 'default' | 'small';
children?: ReactNode;
}
/** A filled action. Its label names the action: "Talk to us", never "Learn more". */
export function Button({ href, size = 'default', children }: ButtonProps) {
const className = cx('button', size === 'small' && 'button--small');
if (href) {
return (
<a className={className} href={href}>
{children}
</a>
);
}
return (
<button className={className} type="button">
{children}
</button>
);
}