API reference
components/hold-button
Import
Section titled “Import”import * as api from "@fungi.computer/caps/components/hold-button";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | HoldButtonProps | Props accepted by HoldButton. |
| constant | HoldButton | For an action nothing can undo: press and hold (pointer, Space or Enter) while a fill rises; let go early and it drops back; hold to the top and the action runs. Under reduced motion the fill rises in three steps. |
HoldButtonPropstype alias
Section titled “HoldButtonProps”type HoldButtonProps = object & Omit<ButtonProps, "children" | "onClick">;Props accepted by HoldButton.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
children |
ReactNode |
- |
onConfirm() |
() => void |
Runs once the button has been held for holdMs. |
holdMs? |
number |
How long to hold, in milliseconds: a deliberate pause, not motion. |
holdHint? |
string |
Spoken description of the gesture. |
HoldButtonconstant
Section titled “HoldButton”const HoldButton: ForwardRefExoticComponent< object & Omit<ButtonProps, "children" | "onClick"> & RefAttributes<HTMLButtonElement>>;For an action nothing can undo: press and hold (pointer, Space or Enter) while a fill rises; let go early and it drops back; hold to the top and the action runs. Under reduced motion the fill rises in three steps.