Usage

Embed a hosted help page

This type is used by WebView

tsx
import { WebView } from 'kuito';

export default function Help() {
  return <WebView flex={1} src="https://example.com/help" />;
}

Type declaration

ts
export type WebViewProps = {
  /** The page to load. Set `src` or `html`, not both. */
  src?: WebViewSource;
  /** Inline HTML, resolved against `baseUrl` when given. */
  html?: string | { html: string; baseUrl?: string };
  /**
   * Origins the WebView navigates to, as wildcard patterns (`https://*`).
   * The main frame's navigations elsewhere open through Linking instead.
   * `["http://*", "https://*"]` by default.
   */
  allowedOrigins?: string[];
  /** Runs in the main frame each time a document finishes loading. */
  injectedJavaScript?: string;
  /** True by default. */
  javaScriptEnabled?: boolean;
  /** iOS only: swipe from an edge to go back or forward. False by default. */
  swipeNavigation?: boolean;
  /** Replaces the platform's user agent. */
  userAgent?: string;
  onLoadStart?: (event: WebViewNavigationEvent) => void;
  /** The page loaded. */
  onLoad?: (event: WebViewNavigationEvent) => void;
  /** The load ended, loaded or failed. */
  onLoadEnd?: (event: WebViewNavigationEvent) => void;
  onError?: (event: WebViewErrorEvent) => void;
  /** The URL, title, loading state or history changed. */
  onNavigate?: (event: WebViewNavigationEvent) => void;
  onMessage?: (event: WebViewMessageEvent) => void;
};

Members 13

NameTypeRequiredDescription
srcWebViewSourceNoThe page to load. Set src or html, not both.
htmlstring | { html: string; baseUrl?: string;}NoInline HTML, resolved against baseUrl when given.
allowedOriginsstring[]NoOrigins the WebView navigates to, as wildcard patterns (https://*). The main frame's navigations elsewhere open through Linking instead. ["http://*", "https://*"] by default.
injectedJavaScriptstringNoRuns in the main frame each time a document finishes loading.
javaScriptEnabledbooleanNoTrue by default.
swipeNavigationbooleanNoiOS only: swipe from an edge to go back or forward. False by default.
userAgentstringNoReplaces the platform's user agent.
onLoadStart(event: WebViewNavigationEvent) => voidNo—
onLoad(event: WebViewNavigationEvent) => voidNoThe page loaded.
onLoadEnd(event: WebViewNavigationEvent) => voidNoThe load ended, loaded or failed.
onError(event: WebViewErrorEvent) => voidNo—
onNavigate(event: WebViewNavigationEvent) => voidNoThe URL, title, loading state or history changed.
onMessage(event: WebViewMessageEvent) => voidNo—
onLoadStart — method signatures

Signatures

ts
(event: WebViewNavigationEvent): void

Parameters

NameTypeRequiredDescription
eventWebViewNavigationEventYes—

Returns

void

onLoad — method signatures

Signatures

ts
(event: WebViewNavigationEvent): void

Parameters

NameTypeRequiredDescription
eventWebViewNavigationEventYes—

Returns

void

onLoadEnd — method signatures

Signatures

ts
(event: WebViewNavigationEvent): void

Parameters

NameTypeRequiredDescription
eventWebViewNavigationEventYes—

Returns

void

onError — method signatures

Signatures

ts
(event: WebViewErrorEvent): void

Parameters

NameTypeRequiredDescription
eventWebViewErrorEventYes—

Returns

void

onNavigate — method signatures

Signatures

ts
(event: WebViewNavigationEvent): void

Parameters

NameTypeRequiredDescription
eventWebViewNavigationEventYes—

Returns

void

onMessage — method signatures

Signatures

ts
(event: WebViewMessageEvent): void

Parameters

NameTypeRequiredDescription
eventWebViewMessageEventYes—

Returns

void

Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.