Referencia de API

Theme

Esta página de API está disponible actualmente en inglés. Las firmas y los identificadores no cambian con el idioma.

Theme is the shape of defaultTheme, exported by @univerjs/themes and @univerjs/presets. Start with a complete theme and override the tokens you need:

TypeScript
import type { Theme } from '@univerjs/themes'import { Univer } from '@univerjs/core'import { defaultTheme } from '@univerjs/themes'const theme: Theme = {  ...defaultTheme,  primary: {    ...defaultTheme.primary,    600: '#2563eb',  },}const univer = new Univer({ theme })

The theme includes color scales, semantic tokens, and component-specific values. Preserve the other keys when changing one group. For runtime switching, use univerAPI.setTheme(); plugin implementations should read the active theme through ThemeService.

¿Cómo es esta guía?

© 2026 DreamNum Co., Ltd.