# element

DOM element creation, retrieval, and dimension-tracking helpers.

[`createElement`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-createElement) builds a configured element from an [`ElementConfig`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-ElementConfig) (tag, attributes, children, listeners) and returns it with [`ElementMethods`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-ElementMethods) attached for fluent updates. The per-tag shortcuts (`div`, `span`, [`button`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-button), [`input`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-input), `img`, [`paragraph`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-paragraph), [`header`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-header), [`section`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-section), [`unorderedList`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-unorderedList), table-cell helpers, etc.) are pre-bound versions of [`createElement`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-createElement) for the common HTML tags. [`getElementAsync`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-getElementAsync) resolves an element by ref or selector once it appears in the DOM, with [`OnSuccess`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-OnSuccess)/[`OnFail`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-OnFail) callbacks for the timeout case. [`onElementResize`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-onElementResize) registers an [`ElementResizeCallback`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/#api-ElementResizeCallback) against `ResizeObserver` to track dimension changes without polling.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/utils/ui/element/
This file: https://www.hyperfrontend.dev/docs/libraries/utils/ui/element.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
