kor TürkçeGitHub

HoldButton

Requires a deliberate hold before confirming an action.

kor/ui/HoldButtonSource

When to use

  • Add a deliberate step to an action that is hard to undo.

Examples

Confirm by holding

Loading the example

<k:HoldButton text="Hold to confirm" doneText="Confirmed" confirm=".onConfirm"/>

Release a shipment

Loading the example

<k:Stack gap="10">
	<k:Text text="{/status}"/>
	<k:HoldButton id="release" text="Hold to release" doneText="Released" icon="truck" duration="1200" confirm=".onRelease"/>
	<k:Button kind="ghost" text="Reset example" press=".onReset"/>
</k:Stack>

Keyboard

Space
Hold until the action is confirmed.
Enter
Press twice while focus stays on the button.

API

Properties

NameTypeDefaultDescription
textstringButton text
doneTextstringText after confirmation
iconstringcheckIcon name
durationint900Hold time in milliseconds
donebooleanfalseWhether the action has been confirmed
enabledbooleantrueWhether the button can be used

Events

NameTypeDescription
confirmThe action was confirmed

Related

ButtonConfirm