Skip to content

Custom HTML components

Greg Bowler edited this page May 9, 2026 · 10 revisions
  • Explain reusable custom elements inside page views.
  • Clarify the difference between WebEngine components and browser-defined web components.
  • Explain how the HTML component can have its own PHP with a Binder that's isolated to the element.

When to use components

  • Reuse markup patterns.
  • Keep page views smaller.
  • Attach component-specific logic where needed.

Component discovery

  • Explain the component directory and naming conventions.
  • Explain how component logic files are paired.

Good component boundaries

  • Encourage components for repeated UI fragments with clear inputs.
  • Warn against turning the whole app into deeply nested component trees without need.
  • Reiterate how the Binder has a context of the component's element to prevent binding outside the document scope.

HTML views can also be extended and kept tidy in page partials, and the view can be made dynamic by binding data to the DOM.

Clone this wiki locally