API reference: @salmonui/buttons/button
ButtonBasePropsinterface
import type { ButtonBaseProps } from '@salmonui/buttons/button';interface ButtonBaseProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'color'> {
children?: ReactNode;
variant?: ButtonVariant | undefined;
tone?: ButtonTone | undefined;
size?: ButtonSize | undefined;
iconStart?: ReactNode;
iconEnd?: ReactNode;
iconOnly?: boolean | undefined;
loading?: boolean | undefined;
loadingLabel?: string | undefined;
spinner?: ReactNode;
progress?: number | undefined;
progressLabel?: ((value: number) => string) | undefined;
floating?: boolean | ButtonFloatingPosition | undefined;
floatingScope?: 'viewport' | 'parent' | undefined;
repeat?: boolean | ButtonRepeatOptions | undefined;
onRepeat?: ((event: ButtonRepeatEvent) => void) | undefined;
render?: ((props: ButtonRenderProps) => ReactElement) | undefined;
ref?: Ref<HTMLButtonElement> | undefined;
}
| Name | Signature | Description |
|---|---|---|
childrenoptional | children?: ReactNode; | |
variantoptional | variant?: ButtonVariant | undefined; | Visual weight. Default |
toneoptional | tone?: ButtonTone | undefined; | Color role. Default |
sizeoptional | size?: ButtonSize | undefined; | Metric set. Default |
iconStartoptional | iconStart?: ReactNode; | Decorative icon before the label (inline-start; follows |
iconEndoptional | iconEnd?: ReactNode; | Decorative icon after the label (inline-end; follows |
iconOnlyoptional | iconOnly?: boolean | undefined; | Square metrics for a button that shows only an icon; requires |
loadingoptional | loading?: boolean | undefined; | Shows a spinner, sets |
loadingLabeloptional | loadingLabel?: string | undefined; | Visually hidden text appended to the name while |
spinneroptional | spinner?: ReactNode; | Replaces the built-in spinner graphic. |
progressoptional | progress?: number | undefined; | Progress fill from inline-start, 0 to 100. No spinner unless |
progressLabeloptional | progressLabel?: ((value: number) => string) | undefined; | Visually hidden progress text appended to the name. Default |
floatingoptional | floating?: boolean | ButtonFloatingPosition | undefined; | Floating action button: circular, elevated, positioned by CSS. |
floatingScopeoptional | floatingScope?: 'viewport' | 'parent' | undefined; |
|
repeatoptional | repeat?: boolean | ButtonRepeatOptions | undefined; | Press-and-hold repeat. |
onRepeatoptional | onRepeat?: ((event: ButtonRepeatEvent) => void) | undefined; | Each repeat while held; the first activation is the native |
renderoptional | render?: ((props: ButtonRenderProps) => ReactElement) | undefined; | Renders another element (a link, a router link) with the computed props. |
refoptional | ref?: Ref<HTMLButtonElement> | undefined; | The |