interface / @typed/ui/Dialog

TriggerOptions

Options for a dialog-opening button.

Learn this UI primitive →

Package version
1.0.0-beta.13
Category
Opening controls
Since
1.0.0

Import

import { TriggerOptions } from "@typed/ui/Dialog";

Signatures

export interface TriggerOptions extends Dom.HostOptions<HTMLButtonElement> {
    readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
    readonly controls?: string;
    readonly content: Renderable.Any;
}

Why

The trigger exposes dialog relationship and expanded state to the platform.

Ownership and lifetime

Options are inert; rendering owns listeners/subscriptions by Scope.

Property: content

Visible trigger content and accessible name.

Property: content: Why

A dialog trigger must be discoverable to assistive technology.

Property: content: Ownership and lifetime

Dynamic content follows the trigger Scope.

Property: controls

Dialog id targeted by native command attributes.

Property: controls: Why

With an id, the trigger emits commandfor and command="show-modal" and deliberately omits its Fx click fallback. That form therefore requires browser support for native command attributes. Without controls, Typed installs the state-driven click fallback instead.

Property: controls: Ownership and lifetime

The string is reflected and retains no resources.

Property: state

Hydrated state shared with dialog content.

Property: state: Why

One source drives aria-expanded and dialog visibility.

Property: state: Ownership and lifetime

The trigger borrows state; its originating Scope owns it.

Other public imports

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

Source