525

Hooks

Browse our library of useful hooks.

/
IsMac

A hook to determine if the user is on a Mac.

UseAutoScroll

A hook to enable the creation of containers that automatically scroll to the bottom of their content.

UseBoolean

A hook to simplify working with boolean values.

UseClipboard

A hook to simplify copying text to the clipboard.

UseFrecency

A hook to track and sort items based on their frequency of use.

UseMedia

A hook to track the size of the screen using the standard Tailwind CSS breakpoints.

UsePromise

A hook to manage the state of a promise reactively in the absence of {#await}.

UseRamp

Repeatedly call a function on an accelerating schedule while a condition holds (hold-to-repeat, ramping counter).

UseToc

A hook used to generate a table of contents based on the page content