interface / @typed/ui/Focusable

FocusableOptions

Options for a generic focusable host.

Learn this UI primitive →

Package version
1.0.0-beta.13
Category
Keyboard focus
Since
1.0.0

Import

import { FocusableOptions } from "@typed/ui/Focusable";

Signatures

export interface FocusableOptions extends Dom.HostOptions<HTMLDivElement> {
    readonly content: Renderable.Any;
    readonly role?: Renderable.Any<string | null | undefined>;
    readonly tabIndex?: Renderable.Any<number | null | undefined>;
}

Why

Some composite patterns need a focus target without adding a specialized widget role. These options make that choice explicit.

Ownership and lifetime

The model is inert; rendered dynamic values live for the component Scope.

Property: content

Content rendered inside the focusable host.

Property: content: Why

Content remains independent of the focus behavior.

Property: content: Ownership and lifetime

Dynamic content follows the rendered Scope and is released with it.

Property: role

Optional ARIA role for the focus target.

Property: role: Why

Callers, not Typed, know which widget semantics apply.

Property: role: Ownership and lifetime

The reflected value retains no resources.

Property: tabIndex

Tab order value; defaults to zero.

Property: tabIndex: Why

An explicit tab index makes a non-interactive host keyboard reachable.

Property: tabIndex: Ownership and lifetime

Dynamic values are observed only for the component Scope.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source