# Visibility

Control the visibility of elements without affecting their layout using visibility utility classes.

The `.visible` and `.invisible` classes toggle the CSS [visibility](<https://developer.mozilla.org/en-US/docs/Web/CSS/visibility>) property. Unlike `display: none`, elements with `.invisible` remain in the document flow and still occupy space on the page.

Use `.visible` to make an element visible, or `.invisible` to hide it while preserving its layout space.

```
<div class="invisible">...</div> <div class="visible">...</div>
```

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './visibility.html',
  styles: `
    :host {
      div {
        padding: 0.5rem;
        margin: 0.5rem;
        background-color: var(--si-sys-color-background-1);
      }
    }
  `,
  host: {
    class: 'p-5'
  }
})
export class SampleComponent {}
```

Template:

```html
<div class="invisible">This is invisible</div>
<div class="visible">This is visible</div>
```
