Skip to content

CustomTabOptions

Configuration object that controls the appearance and behavior of a Custom Tab session.

Overview

CustomTabOptions contains optional settings for CustomTab. All properties are nullable. Unset values use system or browser defaults.

Use CustomTabOptionsBuilder to configure values and create instances.

Partial tab-related options apply when launching with LaunchUrlWithSession().

Creating Instances

var options = new CustomTabOptionsBuilder()
    .WithColorScheme(ColorScheme.Dark)
    .WithTitleShowed(true)
    .Build();

_customTab.LaunchUrlWithSession("https://example.com", options);

Properties

TitleShowed

public bool? TitleShowed { get; internal set; }

Whether the page title is shown in the toolbar.

ShareState

public ShareState? ShareState { get; internal set; }

Controls share button visibility.

UrlHidingEnabled

public bool? UrlHidingEnabled { get; internal set; }

Whether the URL bar hides while scrolling.

BookmarksButtonEnabled

public bool? BookmarksButtonEnabled { get; internal set; }

Whether the bookmarks button is shown.

DownloadButtonEnabled

public bool? DownloadButtonEnabled { get; internal set; }

Whether the download button is shown.

CloseButtonPosition

public CloseButtonPosition? CloseButtonPosition { get; internal set; }

Position of the close button.

CloseButtonIcon

public CloseButtonIcon? CloseButtonIcon { get; internal set; }

Close button icon style.

ColorScheme

public ColorScheme? ColorScheme { get; internal set; }

Theme mode for the Custom Tab.

LightColorSchemeOptions

public ColorSchemeOptions? LightColorSchemeOptions { get; internal set; }

Color overrides used in light mode.

DarkColorSchemeOptions

public ColorSchemeOptions? DarkColorSchemeOptions { get; internal set; }

Color overrides used in dark mode.

DefaultColorSchemeOptions

public ColorSchemeOptions? DefaultColorSchemeOptions { get; internal set; }

Fallback color overrides used when mode-specific options are not applied.

InitialHeightPx

public int? InitialHeightPx { get; internal set; }

Initial height in pixels for bottom-sheet mode.

Remarks

  • Value is clamped between 50% and 100% of the screen.

HeightResizeBehavior

public HeightResizeBehavior? HeightResizeBehavior { get; internal set; }

Resize behavior for bottom-sheet mode.

ToolbarCornerRadiusDp

public int? ToolbarCornerRadiusDp { get; internal set; }

Toolbar corner radius in dp for bottom-sheet mode.

Remarks

  • Allowed values range from 1 to 16.

SideSheetBreakingPointDp

public int? SideSheetBreakingPointDp { get; internal set; }

Screen width breakpoint (dp) for switching to side-sheet mode.

Remarks

  • Side-sheet is not displayed if screen width is less than 600dp.

InitialWidthPx

public int? InitialWidthPx { get; internal set; }

Initial width in pixels for side-sheet mode.

Remarks

  • For window width >= 600dp and < 840dp, side-sheet width can be between 50% and 100%.
  • For window width >= 840dp, side-sheet width can be between 33% and 100%.

SideSheetPosition

public SideSheetPosition? SideSheetPosition { get; internal set; }

Position of the side-sheet.

SideSheetDecorationType

public SideSheetDecoration? SideSheetDecorationType { get; internal set; }

Decoration style for the side-sheet.

SideSheetMaximizationEnabled

public bool? SideSheetMaximizationEnabled { get; internal set; }

Whether side-sheet maximization is enabled.

SideSheetRoundedCornersPosition

public SideSheetRoundedCornersPosition? SideSheetRoundedCornersPosition { get; internal set; }

Which side-sheet corners are rounded.

BackgroundInteractionEnabled

public bool? BackgroundInteractionEnabled { get; internal set; }

Whether interaction with the app behind the tab is allowed in partial mode.

OpenAnimation

public CustomTabAnimation? OpenAnimation { get; internal set; }

Animation pair used when opening the tab.

CloseAnimation

public CustomTabAnimation? CloseAnimation { get; internal set; }

Animation pair used when closing the tab.

EphemeralBrowsingEnabled

public bool? EphemeralBrowsingEnabled { get; internal set; }

Whether ephemeral browsing is enabled.

ShareIdentityEnabled

public bool? ShareIdentityEnabled { get; internal set; }

Whether app-specific history sharing is enabled.

SendToExternalDefaultHandlerEnabled

public bool? SendToExternalDefaultHandlerEnabled { get; internal set; }

Whether matching URLs are routed to external default handlers.