[Tutti i componenti](components.md)

# Pulsante schermo intero

Chiede all'host di mostrare l'app a schermo intero, e di tornare indietro. Non mostra niente quando l'host non offre lo schermo intero (molti host su mobile non lo offrono), quindi puoi lasciarlo nel template.

(Qui la pagina HTML mostra una demo dal vivo: https://umb0o.github.io/ngx-mcp-apps/it/component-mcp-fullscreen-button.html)

**Uso:** `<mcp-fullscreen-button />`

File: [`mcp-fullscreen-button.ts`](../components/mcp-fullscreen-button.ts)

```ts
/**
 * Fullscreen button
 *
 * Asks the host to show the app in fullscreen, and back. It renders nothing when the host does not offer
 * fullscreen (many mobile hosts do not), so you can leave it in the template.
 *
 * Usage: `<mcp-fullscreen-button />`
 */
import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';
import { McpApp } from 'ngx-mcp-apps';

@Component({
  selector: 'mcp-fullscreen-button',
  standalone: true,
  changeDetection: ChangeDetectionStrategy.OnPush,
  template: `
    @if (mcp.canFullscreen()) {
      <button type="button" (click)="mcp.toggleFullscreen()">{{ label() }}</button>
    }
  `,
  styles: `
    button {
      font: inherit;
      color: inherit;
      cursor: pointer;
      padding: 0.3em 0.8em;
      border-radius: 6px;
      background: transparent;
      border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
    }
    button:hover {
      background: color-mix(in srgb, currentColor 8%, transparent);
    }
  `,
})
export class McpFullscreenButton {
  protected readonly mcp = inject(McpApp);
  protected readonly label = computed(() =>
    this.mcp.displayMode() === 'fullscreen' ? 'Exit fullscreen' : 'Fullscreen',
  );
}
```


