Common components (e.g. <div>)·续2

  • onPointerEnter: A PointerEvent handler function. Fires when a pointer moves inside an element. Does not have a capture phase. Instead, onPointerLeave and onPointerEnter propagate from the element being left to the one being entered.
  • onPointerLeave: A PointerEvent handler function. Fires when a pointer moves outside an element. Does not have a capture phase. Instead, onPointerLeave and onPointerEnter propagate from the element being left to the one being entered.
  • onPointerMove: A PointerEvent handler function. Fires when a pointer changes coordinates.
  • onPointerMoveCapture: A version of onPointerMove that fires in the capture phase.
  • onPointerOut: A PointerEvent handler function. Fires when a pointer moves outside an element, if the pointer interaction is cancelled, and a few other reasons.
  • onPointerOutCapture: A version of onPointerOut that fires in the capture phase.
  • onPointerUp: A PointerEvent handler function. Fires when a pointer is no longer active.
  • onPointerUpCapture: A version of onPointerUp that fires in the capture phase.
  • onPaste: A ClipboardEvent handler function. Fires when the user tries to paste something from the clipboard.
  • onPasteCapture: A version of onPaste that fires in the capture phase.
  • onScroll: An Event handler function. Fires when an element has been scrolled. This event does not bubble.
  • onScrollCapture: A version of onScroll that fires in the capture phase.
  • onSelect: An Event handler function. Fires after the selection inside an editable element like an input changes. React extends the onSelect event to work for contentEditable={true} elements as well. In addition, React extends it to fire for empty selection and on edits (which may affect the selection).
  • onSelectCapture: A version of onSelect that fires in the capture phase.
  • onTouchCancel: A TouchEvent handler function. Fires when the browser cancels a touch interaction.
  • onTouchCancelCapture: A version of onTouchCancel that fires in the capture phase.
  • onTouchEnd: A TouchEvent handler function. Fires when one or more touch points are removed.
  • onTouchEndCapture: A version of onTouchEnd that fires in the capture phase.
  • onTouchMove: A TouchEvent handler function. Fires one or more touch points are moved.
  • onTouchMoveCapture: A version of onTouchMove that fires in the capture phase.
  • onTouchStart: A TouchEvent handler function. Fires when one or more touch points are placed.
  • onTouchStartCapture: A version of onTouchStart that fires in the capture phase.
  • onTransitionEnd: A TransitionEvent handler function. Fires when a CSS transition completes.
  • onTransitionEndCapture: A version of onTransitionEnd that fires in the capture phase.
  • onWheel: A WheelEvent handler function. Fires when the user rotates a wheel button.
  • onWheelCapture: A version of onWheel that fires in the capture phase.
  • role: A string. Specifies the element role explicitly for assistive technologies.
  • slot: A string. Specifies the slot name when using shadow DOM. In React, an equivalent pattern is typically achieved by passing JSX as props, for example <Layout left={<Sidebar />} right={<Content />} />.
  • spellCheck: A boolean or null. If explicitly set to true or false, enables or disables spellchecking.
  • tabIndex: A number. Overrides the default Tab button behavior. Avoid using values other than -1 and 0.
  • title: A string. Specifies the tooltip text for the element.
  • translate: Either 'yes' or 'no'. Passing 'no' excludes the element content from being translated.

You can also pass custom attributes as props, for example mycustomprop="someValue". This can be useful when integrating with third-party libraries. The custom attribute name must be lowercase and must not start with on. The value will be converted to a string. If you pass null or undefined, the custom attribute will be removed.

These events fire only for the <form> elements:

These events fire only for the <dialog> elements. Unlike browser events, they bubble in React:

These events fire only for the <details> elements. Unlike browser events, they bubble in React:

These events fire for <img>, <iframe>, <object>, <embed>, <link>, and SVG <image> elements. Unlike browser events, they bubble in React:

These events fire for resources like <audio> and <video>. Unlike browser events, they bubble in React: