Full HTML5 Element Support

Java classes for every HTML5 element—construct type-safe HTML entirely in Java.

Structural Elements

Div, Span, Section, Article, Header, Footer, Nav, Main, Aside—every structural element has its own Java class.

Form Elements

TextInput, PasswordInput, Checkbox, RadioButton, Select, TextArea, and more. Full form support with typed inputs.

Table Elements

Table, Thead, Tbody, Tr, Th, Td—build data tables programmatically with proper semantic structure.

Media Elements

Image, Video, Audio, Canvas, and Source elements. Embed media with type-safe attribute configuration.

Semantic Elements

H1–H6, Paragraph, Anchor, Blockquote, Figure, Time, and other semantic elements for meaningful markup.

SVG Support

Create inline SVG graphics with Element for SVG-specific tags. Combine with CSS styling for scalable visuals.

HTML5 Elements in Action

Use concrete Java classes for every element. The compiler verifies your structure, and your IDE provides autocomplete for every attribute and method.

Java
// Structural layout
Div container = new Div();
container.setPadding("40px");
container.setMaxWidth("1200px");
container.setMargin("0 auto");

// Semantic heading
H1 title = new H1();
title.setText("Product Catalog");
title.setColor("#1f2937");
container.addElement(title);

// Data table
Table table = new Table();
table.setWidth("100%");
table.setBorderCollapse("collapse");

Thead thead = new Thead();
Tr headerRow = new Tr();
headerRow.addElement(createTh("Name"));
headerRow.addElement(createTh("Category"));
headerRow.addElement(createTh("Price"));
thead.addElement(headerRow);
table.addElement(thead);

Tbody tbody = new Tbody();
for (Product product : products)
{
    Tr row = new Tr();

    Td nameCell = new Td();
    nameCell.setText(product.getName());
    row.addElement(nameCell);

    Td categoryCell = new Td();
    categoryCell.setText(product.getCategory());
    row.addElement(categoryCell);

    Td priceCell = new Td();
    priceCell.setText(String.format("$%.2f", product.getPrice()));
    priceCell.setTextAlign(TextAlign.RIGHT);
    row.addElement(priceCell);

    tbody.addElement(row);
}
table.addElement(tbody);
container.addElement(table);

// Form with typed inputs
Form form = new Form();
form.setMarginTop("40px");

TextInput searchInput = new TextInput();
searchInput.setName("query");
searchInput.setPlaceholder("Search products...");
searchInput.setWidth("300px");
form.addElement(searchInput);

Select categorySelect = new Select();
categorySelect.setName("category");
categorySelect.addOption("all", "All Categories");
categorySelect.addOption("electronics", "Electronics");
categorySelect.addOption("clothing", "Clothing");
form.addElement(categorySelect);

Button submitBtn = new Button("Search");
submitBtn.setType("submit");
form.addElement(submitBtn);

container.addElement(form);

Benefits of Typed Elements

Compile-Time Checking

Misspell a tag name in a template and you get a silent bug. Misspell a class name in Java and the compiler stops you immediately.

IDE Autocomplete

Type "new T" and your IDE shows Table, Td, TextInput, TextArea, and every other element. Select one and see all its methods instantly.

No String Typos

No more <div clas="wrong"> or <input tpye="text">. Java classes and methods eliminate an entire category of bugs that template systems allow.

Consistent API

Every element follows the same patterns: constructors, setters, addElement(). Learn the conventions once and apply them to any element in the library.

Discoverable API

Browse the element hierarchy in your IDE to find exactly what you need. JavaDoc, source code, and type information are always one click away.