Common components (e.g. <div>)·续2
onPointerEnter: APointerEventhandler function. Fires when a pointer moves inside an element. Does not have a capture phase. Instead,onPointerLeaveandonPointerEnterpropagate from the element being left to the one being entered.onPointerLeave: APointerEventhandler function. Fires when a pointer moves outside an element. Does not have a capture phase. Instead,onPointerLeaveandonPointerEnterpropagate from the element being left to the one being entered.onPointerMove: APointerEventhandler function. Fires when a pointer changes coordinates.onPointerMoveCapture: A version ofonPointerMovethat fires in the capture phase.onPointerOut: APointerEventhandler function. Fires when a pointer moves outside an element, if the pointer interaction is cancelled, and a few other reasons.onPointerOutCapture: A version ofonPointerOutthat fires in the capture phase.onPointerUp: APointerEventhandler function. Fires when a pointer is no longer active.onPointerUpCapture: A version ofonPointerUpthat fires in the capture phase.onPaste: AClipboardEventhandler function. Fires when the user tries to paste something from the clipboard.onPasteCapture: A version ofonPastethat fires in the capture phase.onScroll: AnEventhandler function. Fires when an element has been scrolled. This event does not bubble.onScrollCapture: A version ofonScrollthat fires in the capture phase.onSelect: AnEventhandler function. Fires after the selection inside an editable element like an input changes. React extends theonSelectevent to work forcontentEditable={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 ofonSelectthat fires in the capture phase.onTouchCancel: ATouchEventhandler function. Fires when the browser cancels a touch interaction.onTouchCancelCapture: A version ofonTouchCancelthat fires in the capture phase.onTouchEnd: ATouchEventhandler function. Fires when one or more touch points are removed.onTouchEndCapture: A version ofonTouchEndthat fires in the capture phase.onTouchMove: ATouchEventhandler function. Fires one or more touch points are moved.onTouchMoveCapture: A version ofonTouchMovethat fires in the capture phase.onTouchStart: ATouchEventhandler function. Fires when one or more touch points are placed.onTouchStartCapture: A version ofonTouchStartthat fires in the capture phase.onTransitionEnd: ATransitionEventhandler function. Fires when a CSS transition completes.onTransitionEndCapture: A version ofonTransitionEndthat fires in the capture phase.onWheel: AWheelEventhandler function. Fires when the user rotates a wheel button.onWheelCapture: A version ofonWheelthat 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 totrueorfalse, enables or disables spellchecking.tabIndex: A number. Overrides the default Tab button behavior. Avoid using values other than-1and0.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:
onReset: AnEventhandler function. Fires when a form gets reset.onResetCapture: A version ofonResetthat fires in the capture phase.onSubmit: AnEventhandler function. Fires when a form gets submitted.onSubmitCapture: A version ofonSubmitthat fires in the capture phase.
These events fire only for the <dialog> elements. Unlike browser events, they bubble in React:
onCancel: AnEventhandler function. Fires when the user tries to dismiss the dialog.onCancelCapture: A version ofonCancelthat fires in the capture phase.onClose: AnEventhandler function. Fires when a dialog has been closed.onCloseCapture: A version ofonClosethat fires in the capture phase.
These events fire only for the <details> elements. Unlike browser events, they bubble in React:
onToggle: AnEventhandler function. Fires when the user toggles the details.onToggleCapture: A version ofonTogglethat fires in the capture phase.
These events fire for <img>, <iframe>, <object>, <embed>, <link>, and SVG <image> elements. Unlike browser events, they bubble in React:
onLoad: AnEventhandler function. Fires when the resource has loaded.onLoadCapture: A version ofonLoadthat fires in the capture phase.onError: AnEventhandler function. Fires when the resource could not be loaded.onErrorCapture: A version ofonErrorthat fires in the capture phase.
These events fire for resources like <audio> and <video>. Unlike browser events, they bubble in React:
