# Integrar en Web Component

- Human documentation: [https://docs.univer.ai/es-ES/guides/sheets/getting-started/integrations/web-component](https://docs.univer.ai/es-ES/guides/sheets/getting-started/integrations/web-component)

- Agent Markdown: [https://docs.univer.ai/es-ES/guides/sheets/getting-started/integrations/web-component.md](https://docs.univer.ai/es-ES/guides/sheets/getting-started/integrations/web-component.md)

- Requested language: `es-ES`

- Content language: `es-ES`

- Documentation version: `1.2.0`

- Source: [sheets/getting-started/integrations/web-component.es-ES.mdx](https://github.com/dream-num/documentation/blob/dev/content/guides/sheets/getting-started/integrations/web-component.es-ES.mdx)

---

> [!NOTE]
> Si está buscando cómo utilizar componentes de componentes web como componentes personalizados, consulte [aquí](https://docs.univer.ai/es-ES/guides/sheets/ui/components.md#web-component).

Univer se puede integrar en componentes web.

### Ejemplo

El siguiente código es un ejemplo de integración de Univer en un componente web utilizando [Iluminado](https://lit.dev).

```typescript
import type { Univer } from '@univerjs/presets'
import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core'
import UniverPresetSheetsCoreEnUS from '@univerjs/preset-sheets-core/locales/en-US'
import { createUniver, LocaleType, mergeLocales } from '@univerjs/presets'

import '@univerjs/preset-sheets-core/lib/index.css'

class UniverEditorElement extends HTMLElement {
  private univer?: Univer

  connectedCallback() {
    if (this.univer) return
    const container = this

    const { univer, univerAPI } = createUniver({
      locale: LocaleType.EN_US,
      locales: {
        [LocaleType.EN_US]: mergeLocales(
          UniverPresetSheetsCoreEnUS,
        ),
      },
      presets: [
        UniverSheetsCorePreset({
          container,
        }),
      ],
    })

    univerAPI.createWorkbook({})

    this.univer = univer
  }

  disconnectedCallback() {
    this.univer?.dispose()
    this.univer = undefined
  }
}

customElements.define('univer-sheets-editor', UniverEditorElement)
```

```html
<univer-sheets-editor style="display: block; height: 600px"></univer-sheets-editor>
```
