function / @typed/ui/index

Role.Role

Renders a generic element with caller-selected ARIA semantics.

Learn this UI primitive →

Package version
1.0.0-beta.7
Category
Semantic hosts
Since
1.0.0
Member of
Role

Import

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

Access Role.Role through the imported Role 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 Role<const Options extends RoleOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, RoleInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;

Why

It provides cooperative host composition without pretending every ARIA role has identical keyboard behavior; the caller remains responsible for the chosen role’s complete accessibility contract.

Ownership and lifetime

Running the returned Fx owns dynamic attributes and content until its Effect Scope closes. A custom host must preserve the supplied role.

Examples

import { Role } from "@typed/ui/Role"

const status = Role({ role: "status", content: "Ready" })

Other public imports

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

Source