function / @typed/ui/index

Dialog.Close

Renders a button that closes a dialog without a cancel request.

Learn this UI primitive →

Package version
1.0.0-beta.7
Category
Direct dismissal
Since
1.0.0
Member of
Dialog

Import

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

Access Dialog.Close through the imported Dialog export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export declare function Close<const Options extends CloseOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, CloseInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;

Why

Accepted actions need a direct close path distinct from cancelable dismissal. controls selects native command="close" and disables the Fx click fallback; omit it when native dialog commands are unavailable.

Ownership and lifetime

Running the Fx owns handlers/dynamic content by Scope. Custom hosts must preserve type, command or fallback click behavior, and content.

Examples

import { Effect } from "effect"
import * as Dialog from "@typed/ui/Dialog"

const program = Effect.gen(function* () {
  const state = yield* Dialog.makeState({ open: true })
  return Dialog.Close({ state, content: "Done" })
})

Other public imports

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

Source