API reference: @salmonui/buttons/button
ToggleButtonBasePropsinterface
import type { ToggleButtonBaseProps } from '@salmonui/buttons/button';interface ToggleButtonBaseProps extends Omit<ButtonBaseProps, 'value' | 'name'> {
pressed?: boolean | undefined;
defaultPressed?: boolean | undefined;
onPressedChange?: ((pressed: boolean, event: ToggleChangeEvent) => void) | undefined;
value?: string | undefined;
name?: string | undefined;
}
| Name | Signature | Description |
|---|---|---|
pressedoptional | pressed?: boolean | undefined; | Controlled pressed state. Ignored inside a |
defaultPressedoptional | defaultPressed?: boolean | undefined; | Initial pressed state when uncontrolled; restored on form reset. Default |
onPressedChangeoptional | onPressedChange?: ((pressed: boolean, event: ToggleChangeEvent) => void) | undefined; | Proposed pressed state; called for controlled and uncontrolled buttons. |
valueoptional | value?: string | undefined; | The item's value inside a |
nameoptional | name?: string | undefined; | Standalone form field name: a hidden input carries |
childrenoptionalinherited | children?: ReactNode; | |
variantoptionalinherited | variant?: ButtonVariant; | Visual weight. Default |
toneoptionalinherited | tone?: ButtonTone; | Color role. Default |
sizeoptionalinherited | size?: ButtonSize; | Metric set. Default |
iconStartoptionalinherited | iconStart?: ReactNode; | Decorative icon before the label (inline-start; follows |
iconEndoptionalinherited | iconEnd?: ReactNode; | Decorative icon after the label (inline-end; follows |
iconOnlyoptionalinherited | iconOnly?: boolean; | Square metrics for a button that shows only an icon; requires |
loadingoptionalinherited | loading?: boolean; | Shows a spinner, sets |
loadingLabeloptionalinherited | loadingLabel?: string; | Visually hidden text appended to the name while |
spinneroptionalinherited | spinner?: ReactNode; | Replaces the built-in spinner graphic. |
progressoptionalinherited | progress?: number; | Progress fill from inline-start, 0 to 100. No spinner unless |
progressLabeloptionalinherited | progressLabel?: ((value: number) => string); | Visually hidden progress text appended to the name. Default |
floatingoptionalinherited | floating?: boolean | ButtonFloatingPosition; | Floating action button: circular, elevated, positioned by CSS. |
floatingScopeoptionalinherited | floatingScope?: "parent" | "viewport"; |
|
repeatoptionalinherited | repeat?: boolean | ButtonRepeatOptions; | Press-and-hold repeat. |
onRepeatoptionalinherited | onRepeat?: ((event: ButtonRepeatEvent) => void); | Each repeat while held; the first activation is the native |
renderoptionalinherited | render?: ((props: ButtonRenderProps) => ReactElement<unknown, string | JSXElementConstructor<any>>); | Renders another element (a link, a router link) with the computed props. |
refoptionalinherited | ref?: Ref<HTMLButtonElement>; | The |