Skip to content
Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
DevelopmentBeginner

Facet

A facet in Salesforce is a named region of a parent component that accepts custom content supplied by a developer.

§ 01

Definition

A facet in Salesforce is a named region of a parent component that accepts custom content supplied by a developer. The most common form is the Visualforce tag apex:facet, which places markup into reserved slots such as the header, footer, or caption of data components like apex:dataTable, apex:pageBlockTable, and apex:column. A parent component declares these extension points, and the developer fills them without the parent needing to know what the content will be.

The same word also describes a filter control in search experiences. In Einstein Search, Experience Cloud, Salesforce CMS, and CRM Analytics, a facet lets a user narrow a result set by category, record type, field value, or date. The two senses are related in spirit (a facet focuses content into a defined area) but operationally distinct. Visualforce facets are markup; search facets are interactive filters. Context tells you which one is meant.

§ 02

Two meanings of facet, one shared idea

The apex:facet tag and how it works

apex:facet is a child component that supplies content for a specific named region of its parent. You set the region with the name attribute, then place your markup between the opening and closing tags. Inside an apex:dataTable, name="header" provides a custom header, name="footer" a footer, and name="caption" a caption above the table. The facet body renders only when the parent draws that region, so the position of the markup in your page does not control where it appears. The parent decides placement. A facet can hold simple text or richer markup, but the official guidance is to keep it to a single child component. If you need several elements in one region, wrap them in one container such as apex:outputPanel and put that inside the facet. This keeps the rendered output predictable. The apex:facet tag is one of the oldest pieces of Visualforce, and the pattern it introduced still shapes how reusable Salesforce UI components accept caller-supplied content today.

Which Visualforce parents accept facets

Each parent component publishes the facet names it understands. apex:column accepts header and footer facets, which is how you replace a default column heading with custom markup. apex:dataTable and apex:pageBlockTable accept header, footer, and caption facets for the whole table. apex:tab accepts a label facet so the tab title can be more than plain text. apex:relatedList accepts a header facet. Components tied to AJAX behavior, such as apex:actionStatus, use start and stop facets to show one block while a request runs and another when it finishes. The list of valid names is fixed per component and lives in each tag entry of the Visualforce component reference. A facet name that the parent does not recognize is quietly ignored, with no error at compile or run time. That silent behavior is a frequent source of confusion, so it pays to copy the exact name from the documentation rather than guess.

Why a facet ignores the rendered attribute

A facet is not laid out where it sits in your markup. The parent component pulls the facet content into its own structure when it builds the named region. Because of that, a facet does not behave like a normal page element. The Salesforce best-practices page states that facets only allow content inside them to be rendered if the facet itself is in a component that supports facets. You cannot wrap conditional logic around a facet with the rendered attribute and expect it to toggle, the way you would with apex:outputPanel. If you want to show or hide what lands in a header or footer, put the rendered condition on a component inside the facet, not on the facet tag. Evaluation order also differs from ordinary tags. Treat a facet as a value you hand to the parent, not as a block you position yourself. Misreading this point leads to facets that appear when you expect them gone, or markup that never shows at all.

Facets versus Lightning Web Component slots

Lightning Web Components do not use facets. They use slots, declared with the standard HTML slot element. A slot is a placeholder where a parent component drops markup, and a component can define one default slot plus named slots. The idea matches a Visualforce facet almost exactly: a parent reserves a region, and a caller fills it. When you move older code to LWC, a Visualforce facet usually becomes a named slot. Salesforce publishes a dedicated migration page covering how Aura facets map onto LWC slots, which is useful because Aura sat between Visualforce and LWC and carried facets forward in its own form. To send content to a named slot, you set the slot attribute on your element to match the slot name in the child template. New build work should use slots, since Visualforce is in maintenance mode for most user interface needs. Knowing both the facet and the slot model makes porting and reviewing legacy pages far less painful.

Search facets in Einstein Search and Experience Cloud

The second meaning of facet is a filter the user sees next to search results. After Einstein Search returns records, facets let a person filter by object, by a picklist value, by date, or by other indexed fields, so a long result list becomes manageable. Administrators set up Einstein Search behavior in Setup, and the filters that appear depend on the objects and fields involved. On Experience Cloud sites, search and list components expose similar filter panels so site visitors can refine what they see. The rendering can be checkboxes, dropdowns, or ranges, depending on the field. This kind of facet is configuration and data driven, not hand-coded markup. It shares the name with the Visualforce tag because both carve a focused view out of something larger. For a search facet, the practical concern is choosing which fields are worth filtering on, since every facet you expose adds a decision the user has to make.

Faceting in CRM Analytics dashboards

CRM Analytics uses facet as a verb as much as a noun. When a widget query is faceted, a selection in that widget filters every other faceted widget on the dashboard. Click a bar in a chart, and the tables and other charts update to match the value you picked. Selection-based widgets such as chart, list, range, date, and toggle can broadcast their selections as facets through the Broadcast selections as facets setting. Salesforce applies a selection only to queries grouped on the same field in the same dataset, and only when the selected value exists in that query result. Cross-dataset faceting is possible when you define connected data sources that link fields across datasets. This is what makes a CRM Analytics dashboard feel interactive rather than static. It is the same focusing idea as a Visualforce facet or a search facet, applied to coordinated charts instead of markup regions or filter checkboxes.

Composability, reuse, and a worked example

Facets exist so that reusable components can accept content they do not own. Picture a custom Visualforce table wrapper used across many pages. The wrapper fixes the table styling and behavior, then exposes header and footer facets so each caller supplies its own column titles and totals row. One page passes a header facet with a search box, another passes plain labels, and the wrapper code never changes. That is composition through named regions, and it is the standard way Visualforce component libraries were built. The same pattern, expressed with slots, drives most LWC development today. A reusable lightning card defines slots, and consumers fill them with whatever fits their screen. The lesson carries across both technologies. Design components that reserve clearly named regions, document those names so consumers do not guess, and let callers inject content at the edges. Whether the label is facet or slot, the discipline of well-named extension points is what keeps a component library usable over time.

§

Trust & references

Sources

Cross-checked against the following references.

Official documentation

Straight from the source - Salesforce's reference material on Facet.

Was this entry helpful?
Help us write better definitions. Quick reactions or detailed edit suggestions.

About the Author

Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.

§

Test your knowledge

Q1. In Visualforce, what does the apex:facet tag do?

Q2. In Experience Cloud and Einstein Search, what is a facet?

Q3. Why are the two meanings of facet described as conceptually related but operationally distinct?

§

Discussion

Loading…

Loading discussion…