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

# pointer-events

APISummary
## Introduction

The `pointer-events` CSS property specifies whether a component can respond to touch events.

## Usage Examples

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

**Entry:** `src/pointer-events`
**Bundle:** `dist/pointer-events.lynx.bundle`

```tsx
import { root, useState } from "@lynx-js/react";
import type { TouchEvent } from "@lynx-js/types";
import "./index.scss";

const PointerEvents = () => {
  const [bgColor, setBgColor] = useState("white");
  const [isShow, setIsShow] = useState(false);

  function handleControlTap(e: TouchEvent) {
    "background-only";
    setIsShow(isShow => !isShow);
  }

  function handleContentTap(e: TouchEvent) {
    "background-only";
    const rndCol = `rgb(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${
      Math.floor(Math.random() * 256)
    })`;
    setBgColor(rndCol);
  }

  return (
    <view className="container">
      <view className="control" bindtap={handleControlTap}>
        <text style={{ fontSize: "18px" }}>show or close popup</text>
      </view>
      {isShow
        && (
          <view className="popup" style={{ pointerEvents: "none" }}>
            <view className="mask">
              <view
                className="content"
                style={{ backgroundColor: bgColor, pointerEvents: "auto" }}
                bindtap={handleContentTap}
              />
            </view>
          </view>
        )}
    </view>
  );
};

root.render(<PointerEvents />);

```

v0.11.0



## Syntax

```css
pointer-events: auto;
pointer-events: none;
```

### Values

- `auto`

  Default value. In this case, the node can respond to touch events.

- `none`

  The node cannot respond to touch events.

## Formal Definition

| Initial value | auto |
| Applies to | all elements that don't override hitTest |
| Inherited | no |
| Animatable | no |


## Formal Syntax

```
pointer-events: auto | none;
```

## Differences from the Web

`inherit`, `initial`, and `unset` are not supported. There are no `SVG only` attribute values ​​such as `visiblePaintedroll` and `visibleFill`.

## Notes

- This property has an inheritance effect, that is, when the child node does not set `pointer-events`, it will inherit the `pointer-events` value of the parent node.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.pointer-events`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| pointer-events | Yes (3.5) | Yes (3.5) | Yes (3.5) | Yes (1.0) | Yes (1.0) | Yes |

**`pointer-events`**

**Specifications:**

