Styling your app

Use the App Bridge UI kit so your embedded page looks native in Store Admin.

The App Bridge UI Kit styles content inside your embedded app with tb- classes and light and dark themes. The stylesheet works with plain HTML and any framework. Optional form helpers, such as enhanced selects, file inputs, and date pickers, use JavaScript from the App Bridge SDK. Browse every component at ui.tringify.com. Host-rendered controls are covered separately in UI primitives.

Install the stylesheet#

Link the stylesheet below and use tb- classes in your HTML. Load https://bridge.tringify.com/app-bridge@1.js before calling any TringifyBridge.ui helper. Styling your app does not grant access to host operations; use bridge.supports() after startup to check those capabilities.

index.html html
<link rel="stylesheet" href="https://bridge.tringify.com/app-bridge-ui@1.css">

Follow the merchant's theme#

The kit renders light by default and follows data-theme on the root element. Set it from the App Bridge context when your app boots, and keep it updated on theme:change.

app.js javascript
const bridge = TringifyBridge.init();
await bridge.ready();
const context = await bridge.getContext();
document.documentElement.dataset.theme = context.theme;
bridge.on("theme:change", ({ theme }) => {
  document.documentElement.dataset.theme = theme;
});

Components#

Every UI Kit component, with a live preview in light and dark, the markup to copy, its classes and the SDK calls for enhanced controls, is documented at ui.tringify.com. That site is built from the stylesheet itself, so it always matches the version you load, and its changelog lists what each App Bridge release added or removed.

Style the action with UI Kit's tb-btn tb-btn-outline classes. After await bridge.ready(), hide the button if !bridge.supports('navigate'); otherwise call bridge.billing.openPricing() from its click handler and handle promise errors through your normal app feedback. The host checks unsaved changes before leaving the app. See App Bridge getting started and UI Kit.