Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "types"

Index

Type aliases

Action

Action: { payload?: SkipLink; type: ActionType | string }

Action to be passed to the reducer, via a dispatch function. Manual dispatch calls are unecessary. Use RegisterAction or ClearAction from useSkipLinkActions instead.

const { register, clear } = useSkipLinkActions();

Type declaration

ClearAction

ClearAction: () => void

Resets the SkipLink[] state stored in WithSkipLinks

Type declaration

    • (): void
    • Returns void

RefFunction

RefFunction: (ref: HTMLElement) => void

To be used as the value for an element ref.

<div ref={callback: RefFunction} />

Type declaration

    • (ref: HTMLElement): void
    • Parameters

      • ref: HTMLElement

      Returns void

RegisterAction

RegisterAction: (skipLink: SkipLink) => RefFunction

Registers a SkipLink. Once the element is available in the DOM.

returns

A callback to be used as the ref prop of an element. Once the element is available, the SkipLink will be registered, and the id applied to the given HTMLElement.

Type declaration

SkipLink

SkipLink: { label: string; ref?: HTMLElement; to: string }
param

Screenreader friendly description of the section of the document the selected link with skip to.

param

The HTMLElement id to skip to.

param

Optional ref to the "skip to" HTMLElement. Required for accurate ordering of links.

Type declaration

  • label: string
  • Optional ref?: HTMLElement
  • to: string

SkipLinksState

SkipLinksState: SkipLink[]

WithSkipLinksProps

WithSkipLinksProps: { children: React.ReactNode; defaultSkipLinks?: SkipLinksState }
param

Your application.

param

The optional initial state. Necessary for SSR.

Type declaration

  • children: React.ReactNode
  • Optional defaultSkipLinks?: SkipLinksState

Generated using TypeDoc