@littlespoon/button
Version:
Little Spoon button
26 lines • 975 B
TypeScript
import type React from 'react';
export type Size = 'small' | 'medium' | 'large' | 'xlarge';
export interface SizeByBreakpoint {
[key: number]: Size;
}
export interface Props<C extends React.ElementType> {
/**
* The root node component. Use a string for an HTML element or a component. Defaults to "button".
*/
as?: C;
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* The size of the component. Defaults to "medium".
*/
size?: Size | SizeByBreakpoint;
/**
* The variant to use. Defaults to "primary".
*/
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost';
}
export type ButtonProps<C extends React.ElementType> = Props<C> & Omit<React.ComponentPropsWithoutRef<C>, keyof Props<C>>;
export default function Button<C extends React.ElementType = 'button'>({ size, variant, ...other }: ButtonProps<C>): React.ReactElement<ButtonProps<C>>;
//# sourceMappingURL=Button.d.ts.map