Collection of methods that allow an Eitri-App to update the native dynamic bottom bar at runtime.

The dynamic bottom bar is initially defined by eitriConfig.dynamicBottomBar. These methods let a running Eitri-App change the live bar after startup.

Methods

  • Restores the live dynamic bottom bar to its initial eitriConfig.dynamicBottomBar state — the colors, icons, titles, badges, font and layout it had on first render. This undoes every prior updateStyle call in one operation.

    Because updateStyle is purely additive (it never resets a field to its default), this is the only way to revert the bar. The tab count is never changed; like updateStyle, an icon is re-downloaded only when its URL differs from the one currently shown (avoids flicker).

    const modules = await Eitri.modules();
    const resetStyle = modules?.dynamicBottomBar?.resetStyle;
    if (!resetStyle) return;

    await resetStyle(); // bar looks exactly as it did on first render

    Returns Promise<undefined>

  • Updates the live dynamic bottom bar's visuals with a partial merge: only the fields present in style change; omitted fields keep their current values.

    Tabs are targeted by index through a sparse items list — each entry must carry its index and only the provided sub-fields (title / icon) are applied to that tab. The tab count is never changed by this method.

    This method is purely additive: a field changes only when a present, non-empty value is supplied. Omitting a key — or passing null — leaves that field unchanged. To undo previous changes and return the bar to its initial eitriConfig.dynamicBottomBar state, call resetStyle instead — updateStyle has no per-field "reset to default" semantics.

    To change a tab's badge content (set/update/remove the badge text), use the updateTabBadge method instead — updateStyle only restyles badges through the global badgeBackground / badgeTextColor colors. See BottomBar.updateTabBadge.

    Behavior notes:

    • An icon is only re-downloaded when its URL differs from the current one (avoids flicker). The URL must be https (non-https URLs are rejected and the icon is left unchanged). Provide a transparent-background raster image (PNG); the bar tints it with the bar colors.
    • Colors (backgroundColor, selectedColor, unselectedColor) are applied to the live bar and re-tint icons/labels immediately.
    • badgeBackground / badgeTextColor are global (apply to all badges). Changing them re-colors badges already on screen and applies to future badges. The default (when never set on the live bar nor in the initial config) is a red background + white text. These can also be set in the initial eitriConfig.dynamicBottomBar config.
    • fontFamily selects a font bundled with the brand for the tab labels. The font must already ship with the app (no runtime download). It is a per-platform object because the two platforms reference fonts by different identifiers: fontFamily.android is the Android res/font resource name (e.g. "baloo2_regular"), and fontFamily.ios is the iOS PostScript name (e.g. "Baloo2-Regular"). When a name isn't bundled/registered, labels fall back to the system font. Can also be set in the initial eitriConfig.dynamicBottomBar config.
    • selectedFontFamily is the same per-platform bundled-font selector as fontFamily, but for the selected tab's label. When omitted (never set on the live bar nor in the initial config), the selected tab uses fontFamily. Can also be set in the initial eitriConfig.dynamicBottomBar config.
    • topBorder is the bar's top border: topBorder.thickness (in dp/pt) and topBorder.color (hex string). Setting topBorder.thickness to 0 (or any value <= 0) removes the border, even when a color is set. Otherwise the border renders whenever a thickness greater than zero or a color is set; when both are absent the border is removed. When the border is active, each sub-field falls back on its own: an omitted thickness defaults to 1dp/pt, and an omitted/invalid color defaults to #DBDDE0. Can also be set in the initial eitriConfig.dynamicBottomBar config.
    • iconSize / labelFontSize / iconLabelSpacing / paddingTop / paddingBottom are classic-theme sizing fields, plain numbers. The bar height is not configurable — it is sized to its content (paddingTop + icon [+ iconLabelSpacing + label] + paddingBottom). iconSize and labelFontSize are applied only when a value greater than zero is supplied (an omitted or <= 0 value keeps the theme default, respectively 24 and 12). iconLabelSpacing, paddingTop and paddingBottom accept zero (a negative value is ignored) — iconLabelSpacing: 0 places the icon flush against the label; their defaults are 2, 6 and 6. In the initial eitriConfig.dynamicBottomBar config these live under the classic node.
    const modules = await Eitri.modules();
    const updateStyle = modules?.dynamicBottomBar?.updateStyle;
    if (!updateStyle) return;

    // change only the selected color
    await updateStyle({ selectedColor: "#FF0000" });

    // relabel + change icon of tab 0
    await updateStyle({
    items: [
    { index: 0, title: "Casa", icon: "https://example.com/home.png" },
    ],
    });

    Parameters

    • style: {
          backgroundColor?: string;
          badgeBackground?: string;
          badgeTextColor?: string;
          fontFamily?: { android?: string; ios?: string };
          iconLabelSpacing?: number;
          iconSize?: number;
          items?: { icon?: string; index: number; title?: string }[];
          labelFontSize?: number;
          labels?: "hidden" | "shown";
          paddingBottom?: number;
          paddingTop?: number;
          selectedColor?: string;
          selectedFontFamily?: { android?: string; ios?: string };
          topBorder?: { color?: string; thickness?: number };
          unselectedColor?: string;
      }

      Partial description of the visual changes to apply to the live bottom bar.

      • OptionalbackgroundColor?: string

        New bar background color (hex string).

      • OptionalbadgeBackground?: string

        Global badge background color, applied to all badges (hex string).

      • OptionalbadgeTextColor?: string

        Global badge text color, applied to all badges (hex string).

      • OptionalfontFamily?: { android?: string; ios?: string }

        Tab-label font, bundled with the brand. Per-platform: fontFamily.android is the Android res/font resource name (e.g. "baloo2_regular"); fontFamily.ios is the iOS PostScript name (e.g. "Baloo2-Regular"). Unresolved names fall back to the system font.

      • OptionaliconLabelSpacing?: number

        Classic-theme layout: vertical gap between icon and label, as a plain number. Accepts 0 (icon flush against the label); omitted or a negative value keeps the theme default (2). Lives under the classic node in the initial config.

      • OptionaliconSize?: number

        Classic-theme layout: side of the square tab icon, as a plain number. Omitted or <= 0 keeps the theme default (24). Lives under the classic node in the initial config.

      • Optionalitems?: { icon?: string; index: number; title?: string }[]

        Sparse list of per-tab updates; each entry targets a tab by index.

      • OptionallabelFontSize?: number

        Classic-theme layout: tab-label font size, as a plain number. Omitted or <= 0 keeps the theme default (12). Lives under the classic node in the initial config.

      • Optionallabels?: "hidden" | "shown"

        Classic-theme layout: whether tab titles are shown. "shown" displays the titles; "hidden" hides all titles and vertically centers the icons (icon-only bar). A tab whose title is empty is treated as label-less regardless. Unknown values fall back to "shown". In the initial eitriConfig.dynamicBottomBar config this lives under the classic node.

      • OptionalpaddingBottom?: number

        Classic-theme layout: padding below the content box (icon+label), as a plain number. Contributes to the content-driven bar height. Accepts 0; omitted or a negative value keeps the theme default (6). Lives under the classic node in the initial config.

      • OptionalpaddingTop?: number

        Classic-theme layout: padding above the content box (icon+label), as a plain number. Contributes to the content-driven bar height. Accepts 0; omitted or a negative value keeps the theme default (6). Lives under the classic node in the initial config.

      • OptionalselectedColor?: string

        New color for the selected tab's icon/label (hex string).

      • OptionalselectedFontFamily?: { android?: string; ios?: string }

        Font for the selected tab's label, bundled with the brand. Same per-platform shape as fontFamily; when omitted, the selected tab falls back to fontFamily.

      • OptionaltopBorder?: { color?: string; thickness?: number }

        Bar top border: topBorder.thickness (dp/pt) and topBorder.color (hex string). thickness <= 0 removes the border even when a color is set. Otherwise renders when thickness > 0 or a color is set; both absent removes it. When active, omitted thickness defaults to 1dp/pt and omitted/invalid color to #DBDDE0.

      • OptionalunselectedColor?: string

        New color for unselected tabs' icons/labels (hex string).

    Returns Promise<undefined>