@trail-ui/react
Version:
47 lines (44 loc) • 1.3 kB
TypeScript
import * as react from 'react';
import { ReactNode } from 'react';
import { ButtonProps as ButtonProps$1 } from 'react-aria-components';
import { ButtonVariantProps } from '@trail-ui/theme';
import { SpinnerProps } from '../spinner/spinner.js';
import 'react/jsx-runtime';
interface ButtonProps extends ButtonProps$1, Omit<ButtonVariantProps, 'isInGroup'> {
/**
* The button start content.
*/
startContent?: ReactNode;
/**
* The button end content.
*/
endContent?: ReactNode;
/**
* Spinner to display when loading.
*/
spinner?: ReactNode;
/**
* Props to pass to the spinner.
*/
spinnerProps?: SpinnerProps;
/**
* The spinner placement.
* @default "start"
*/
spinnerPlacement?: 'start' | 'end';
/**
* Whether the button should display a loading spinner.
* @default false
*/
children?: ReactNode;
/**
* Whether the button should display a loading spinner.
*/
isLoading?: boolean;
className?: string;
}
/**
* A button allows a user to perform an action, with mouse, touch, and keyboard interactions.
*/
declare const _Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
export { _Button as Button, ButtonProps };