use-dynamic-geul#

use-dynamic-geul is hook for easily run typing effect witih dynamic values.

function useDynamicGeul(
initial: string,
options: UseDynamicGeulOptions,
): UseDynamicGeulReturn;

initial#

Initial value that displayed before typing.

UseDynamicGeulOptions#

optiontypedescription
speednumberSpeed of typing effect (ms)
decomposeOnBackspaceboolean | undefined

Whether to have the effect of separating consonants when backspace

UseDynamicGeulReturn#

membertypedescription
geulstringTyped value
isRunningbooleanRunning status of the geul instance
run(value: string) => voidfuntion that start typing effect with received value
reset() => voidfuntion that reset typing effect

Examples#

without decomposeOnBackspace#

value:

options:

- speed: 50

- initial: ""

- decomposeOnBackspace:undefined

result:

with decomposeOnBackspace#

value:

options:

- speed: 50

- initial: ""

- decomposeOnBackspace:true

result: