Render elements

In a render array, the #type property points to a render element, a prepackaged render array of common properties with sane defaults that describe display logic for commonly-used HTML components such as tables, links, and form input elements.

There are 2 main kinds of render elements:

  1. Generic render elements: Encapsulate HTML along with attaching CSS and JavaScript for HTML elements or chunks of HTML like a link, pager, or status messages.
  2. Form input elements: HTML elements for most types of form fields like checkbox, button, date selection widget, file upload. These are meant to be used in conjunction with a form controller class along with additional properties such as #required and #element_validate, since they are used within the context of a form.

What Are Render Elements?

Learn about render elements, an important part of Drupal's Render and Form APIs

Guide maintainers

amber himes matz's picture