@papernote/ui
Version:
A modern React component library with a paper notebook aesthetic - minimal, professional, and expressive
68 lines • 1.93 kB
TypeScript
import React from 'react';
/**
* Button component props
*/
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
/** Visual style variant of the button */
variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'outline';
/** Button size */
size?: 'sm' | 'md' | 'lg';
/** Show loading spinner and disable interaction */
loading?: boolean;
/** Icon to display alongside button text */
icon?: React.ReactNode;
/** Position of the icon relative to text */
iconPosition?: 'left' | 'right';
/** Make button take full width of container */
fullWidth?: boolean;
/** Icon-only mode - renders square button with just icon (no text padding) */
iconOnly?: boolean;
/** Badge content (number or text) displayed in top-right corner */
badge?: number | string;
/** Badge color variant */
badgeVariant?: 'primary' | 'success' | 'warning' | 'error';
}
/**
* Button - Interactive button component with variants, sizes, and loading states
*
* A versatile button component that supports multiple visual styles, sizes, icons,
* loading states, and notification badges.
*
* Supports ref forwarding for DOM access.
*
* @example Basic usage
* ```tsx
* <Button variant="primary">Click me</Button>
* ```
*
* @example With icon and loading
* ```tsx
* <Button
* variant="secondary"
* icon={<Save />}
* loading={isSaving}
* >
* Save Changes
* </Button>
* ```
*
* @example Icon-only with badge
* ```tsx
* <Button
* iconOnly
* badge={5}
* badgeVariant="error"
* >
* <Bell />
* </Button>
* ```
*
* @example With ref
* ```tsx
* const buttonRef = useRef<HTMLButtonElement>(null);
* <Button ref={buttonRef}>Focusable</Button>
* ```
*/
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
export default Button;
//# sourceMappingURL=Button.d.ts.map