@littlespoon/button
Version:
Little Spoon button
41 lines (36 loc) • 1.01 kB
Flow
/**
* Flowtype definitions for Button
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.21.0
* @flow
*/
import React from "react";
export type Size = "small" | "medium" | "large" | "xlarge";
export interface SizeByBreakpoint {
[key: number]: Size;
}
export interface Props<C: 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: React.ElementType> = {
...Props<C>,
...$Diff<React.ComponentPropsWithoutRef<C>, { [key: $Keys<Props<C>>]: any }>,
};
declare export default function Button<C: React.ElementType>(
x: ButtonProps<C>
): React.ReactElement<ButtonProps<C>>;