[]previous and next page

MatchProps

Props of Match.

Props of Match. A Match descriptor is the props object itself.

Import#

ts
import type { MatchProps } from "@shadow-js/web";

Signature#

ts
interface MatchProps<T> {
  /** The condition. The first Match whose `when` is truthy is shown. */
  readonly when: T | undefined | null | false | 0 | "";
  /**
   * Same meaning as in {@link ShowLooseProps}: `true` rebuilds the branch when the identity of
   * `when` changes.
   * @default false
   */
  readonly keyed?: boolean;
  /**
   * The branch content: plain content, an accessor, or a callback, as the children of
   * {@link ShowProps}.
   * @default undefined (the selected Match renders nothing)
   */
  readonly children?: unknown;
}

Members#

Name Type Description
T T
when readonly when: T | undefined | null | false | 0 | "" The condition. The first Match whose when is truthy is shown.
keyed? readonly keyed?: boolean Same meaning as in ShowLooseProps: true rebuilds the branch when the identity of when changes.
children? readonly children?: unknown The branch content: plain content, an accessor, or a callback, as the children of ShowProps.