@rarcifa/cronos-design-system
Version:
A typescript react component library following the Cronos branding standards
39 lines (38 loc) • 1.54 kB
TypeScript
/// <reference types="react" />
export interface ButtonProps {
/**
* An optional text label that can be used for the button, providing a text
* representation if not using the `children` prop for content.
*/
label?: string;
/**
* Specifies the variant of the button, with available options 'primary',
* 'secondary', 'dark' and 'active' to be used different scenarios.
*/
variant?: 'primary' | 'secondary' | 'dark' | 'active';
/**
* Sets the font weight of the text. The available options are 'bold', 'medium', and 'default',
* allowing for varied text emphasis within the application.
*/
fontWeight?: 'bold' | 'medium' | 'default';
/**
* Specifies the size of the button, with available options 'sm' (small),
* 'md' (medium), and 'lg' (large) to fit different spaces and design needs.
*/
size?: 'sm' | 'md' | 'lg';
/**
* If true, applies rounded corners to the button, enhancing the visual
* style with a softer, more rounded appearance.
*/
rounded?: boolean;
/**
* Children to be passed into the button. This allows for custom HTML or React components
* to be nested inside the button, enabling more complex layouts and functionality.
*/
children?: React.ReactNode | React.ReactNode[];
/**
* An optional click handler function that is called when the button is clicked,
* allowing for custom behavior on click events.
*/
onClick?: () => void;
}