TX Sheet Control

Appearance and Localization

Topic

Your users can see the spreadsheet editor in a light or a dark appearance, or in the one their browser or system prefers, and in their own interface language. Both are set through the editor's options, SpreadsheetOptions, and through EditorUi. The interface language is independent of the locale that formats numbers and dates.

Set the Theme, Language, Areas and Zoom

The following code changes the theme, the interface language, the visible areas and the zoom of a running editor. editor is the Spreadsheet of the browser editor, created as in JavaScript:

editor.ui.theme = 'dark';
editor.ui.language = 'de';
editor.ui.areas = { statusBar: true, formulaBar: true };
editor.ui.setZoom(110);

The code works as follows:

  • Spreadsheet.ui returns the EditorUi of the editor: its editor-only state and commands.
  • theme selects the light, dark or automatic appearance. Automatic follows the preference of the browser or the system.
  • language sets the interface language, here German.
  • areas shows or hides parts of the editor chrome. A partial areas patch such as this one changes only the areas it supplies.
  • setZoom sets the zoom to 110 percent.

Read resolvedTheme for the effective result, light or dark. Give the host element a stable height when you hide or show chrome.

Worksheet zoom ranges from 25 to 400 percent. SpreadsheetOptions.zoom sets the initial percentage, defaults to 100 and rejects nonfinite or out-of-range values with RangeError. At runtime, setZoom and the writable zoom property round finite values to whole percentages and clamp them to this range; nonfinite values raise TypeError.

The status bar, zoom gestures and Fit Sheet and Fit Width commands use the same 25 percent minimum. Restoring a worksheet's editor view also keeps its zoom within these bounds. Worksheet zoom changes the screen view; print scaling is configured separately in Page Layout and Print Settings.

Spreadsheet in dark appearance: the ribbon, formula bar, worksheet tabs and status bar in dark colors around the sales table

Style the Application Container

The editor has square outer corners by default. To show rounded corners, wrap the editor host in an application-owned container and clip its contents:

<div class="spreadsheet-frame">
    <div id="editor"></div>
</div>
.spreadsheet-frame {
    border-radius: 10px;
    overflow: hidden;
}

#editor {
    height: 640px;
}

Create the editor in the inner editor element. The wrapper controls the outer shape without changing the editor's dialogs or document formatting.

Set the Locale and Currency

The locale and currency options set the default display of numbers and dates. Explicit format codes or locales of a cell override these defaults.

A German interface does not turn arbitrary number strings into typed German amounts. Supply numbers and deliberate date values from your application code.

Register Language Resources

English and German resources are supplied. Your application works with language resources through these functions and methods:

German resources cover the ribbon, status messages, settings dialogs, dashboards, charts and PivotTables, including controls added after a dialog opens. Switching between German and English updates the mounted interface and open dialogs while preserving entered settings, selection and workbook data. Function identifiers, formulas and document text keep their stored values.

To use German and customize the shared Apply hint and the dashboard grid row label, apply overrides to the running editor:

editor.ui.language = 'de';
editor.ui.setResources({
    'dialog.shared.applyHint': 'Änderungen werden mit „Übernehmen“ angewendet.',
    'dashboard.settings.gridRowHeight': 'Rasterzeilenhöhe',
});

Resource names are the supported LocalizationKey values. Overrides belong to this editor instance and remain active across language changes. Pass an empty object to setResources to restore the built-in wording.

Keep the language files reachable at the deployed asset URLs.

Important

Translate Labels Only. Do not translate option keys, formulas, IDs or API member names. Labels and stored identifiers serve different purposes.

How the Theme Differs From Document Styling

The interface theme controls the chrome of the editor. Cell and table styles, drawing fills, chart palettes and dashboard cards are appearance settings of the document.

A dark interface does not require dark printed pages. Review the exported PDF with intentional workbook styles rather than assuming that the browser theme changes the print colors.

Next Steps

Host Style Isolation

The editor mounts its ribbon, worksheet, dashboard, dialogs and menus inside an open shadow root. Its styles are bundled with the browser script and installed automatically. Global application rules, including Bootstrap Reboot, cannot select those internal elements. The application still controls the size and placement of the host element.

Use the public UI API to change theme, language, ribbon layout and visible areas. Public workbook/editor calls and events on the host keep the same behavior. Page-level selectors do not search editor internals; deliberately inspecting them requires host.shadowRoot, and internal markup remains an implementation detail. Destroying a control clears its owned shadow content and styles, and the same host can be used for a new control.