Package org.patternfly.component.title
package org.patternfly.component.title
Provides a title component for styled heading elements.
The title component renders heading elements (h1 through h6) with PatternFly styling.
Each heading level has a default size, but custom sizes can be applied independently of the heading level,
allowing visual flexibility while maintaining semantic HTML structure.
Usage
Create titles with default sizes based on heading level:
import static org.patternfly.component.title.Title.title;
Title h1 = title(1, "Main heading");
Title h2 = title(2, "Sub heading");
Title h3 = title(3, "Section heading");
Create titles with custom sizes independent of the heading level:
import static org.patternfly.component.title.Title.title;
import static org.patternfly.style.Size._4xl;
import static org.patternfly.style.Size.lg;
import static org.patternfly.style.Size.md;
Title large = title(1, _4xl, "Extra large title");
Title medium = title(3, lg, "Large-sized h3");
Title small = title(6, md, "Medium-sized h6");
- See Also:
-
ClassesClassDescriptionA title component applies top and bottom margins, font-weight, font-size, and line-height to titles.