> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# visibility

APISummary
## Introduction

The visibility CSS property shows or hides an element without changing the layout of a document.

## Examples

**This is an example below: css-api**

**Entry:** `src/visibility`
**Bundle:** `dist/visibility.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

import image from "../../resource/lynx.png";

const Visibility = () => {
  const heightStyle = {
    height: "10px",
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view className="fixed_area">
        <image className="relative_image" src={image}></image>
        <view style={heightStyle}></view>
        <image className="relative_image visible" src={image}></image>
        <view style={heightStyle}></view>
        <image className="relative_image hidden" src={image}></image>
      </view>
    </scroll-view>
  );
};

root.render(<Visibility />);

```

v0.11.0



## Syntax

```css
/* Keyword values */
visibility: visible;
visibility: hidden;
```

### Values

`visible`

The element box is visible.

`hidden`

The element box is invisible (not drawn), but still affects layout as normal. Looks like 'opacity: 0'.

## Formal definition

| Initial value | visible |
| Applies to | all elements |
| Inherited | no |
| Animatable | yes |


## Formal syntax

```
visibility =
  visible   |
  hidden
```

## Differences from the Web

`collapse`、`inherit`、`initial`and`unset` are not supported.

When `visibility` is set to `hidden`, all subviews will be invisible, no matter what values their `visibility` are.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.visibility`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/104-visibility.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| visibility | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`visibility`**

**Specifications:**

