Facet
In Salesforce, a Facet is a reusable UI building block that injects content into a named region of a parent component.
Definition
In Salesforce, a Facet is a reusable UI building block that injects content into a named region of a parent component. Its most common form is the Visualforce tag apex:facet, which places markup inside slots like the header, footer, or caption of data components such as apex:dataTable, apex:pageBlockTable, or apex:column. The named-region pattern lets parent components declare extension points without knowing what content the developer will provide.
The term also appears in Experience Cloud, Einstein Search, and Salesforce CMS, where a facet is a filter panel that lets users narrow a list or search result by category, record type, or custom field value. The two meanings are conceptually related (a facet is a slot or filter that focuses content) but operationally distinct: Visualforce facets are markup constructs, search facets are user-facing filter controls. Context tells you which is meant.
How facets work in Salesforce
The Visualforce apex:facet tag
apex:facet is a child tag that specifies content for a named region of its parent component. Inside an apex:dataTable, you can use facet name=header to provide a custom header row, facet name=footer for a footer, facet name=caption for a caption. The facet child is processed only when the parent component renders that named slot. This is Visualforce''s mechanism for letting reusable components accept custom markup at known extension points.
Common Visualforce parents that accept facets
apex:column accepts header and footer facets. apex:dataTable accepts header, footer, and caption facets. apex:pageBlockTable accepts the same. apex:tab accepts a label facet. apex:relatedList accepts a header facet. Each parent documents its supported facet names; using a name that the parent does not recognize is silently ignored.
Lightning Web Components versus Visualforce facets
Lightning Web Components use slots (slot element) instead of facets, but the concept is identical: named regions where parent components accept child markup. LWC named slots are the modern equivalent of Visualforce facets. New development uses slots; legacy Visualforce code still uses apex:facet. Understanding both helps when porting Visualforce to LWC.
Search facets and filter panels
On Experience Cloud sites, Einstein Search, and Salesforce CMS, facets are the filter controls users see alongside search results: filter by record type, field value, date range, tags. The facet panel is configured per search component, listing which fields users can filter on and what filter UI to use (checkboxes, dropdowns, range sliders).
CMS and CRM Analytics facets
Salesforce CMS uses facets to organize content listings: filter articles by topic, author, or publish date. CRM Analytics dashboards support facets that filter all charts on the dashboard by a selected dimension. Both are user-facing filter controls; both share the term facet with the Visualforce construct.
Composability and reusability
Visualforce facets enable component composability: a custom apex:dataTable wrapper can have a fixed header and footer, exposed via facets for callers to fill. This is the standard pattern for building reusable component libraries in Visualforce. The same pattern, expressed through LWC slots, drives most modern Salesforce UI development.
Performance considerations
Facets are inert until their parent renders. A facet defined but never rendered (the parent does not have that named slot) costs nothing at runtime. Heavy facet content (complex apex:repeat blocks, large tables) runs only when the parent renders the slot; this is generally efficient.
How to use apex:facet in a Visualforce page
Using apex:facet is a one-line addition to a Visualforce component: nest the facet tag inside the parent component with the appropriate name attribute. The parent component picks up the facet content at render time.
- Open the Visualforce page
Setup, then Visualforce Pages, then the page you want to modify. Open it in the Developer Console or VS Code.
- Identify the parent component
Find the apex:dataTable, apex:pageBlockTable, or apex:column where you want to inject content. Confirm it supports the facet name you want to use.
- Add the apex:facet child
Inside the parent component, add a child element: apex:facet name=header followed by your custom markup followed by /apex:facet. The name attribute identifies the slot.
- Test the rendering
Preview the page. The custom content should appear in the named slot. If it does not, verify the facet name matches a supported slot on the parent.
- Style as needed
Facet content inherits the parent component''s styling unless overridden. Add CSS classes for custom styling; use inline styles sparingly.
- Consider migration to LWC
For new development, consider building the same UI as a Lightning Web Component with slots. Visualforce is increasingly the legacy path; LWC is where investment is going.
The classic facet tag. Provides named-region content to parent Visualforce components.
The modern equivalent. Same composability concept; built into LWC framework.
User-facing filter panels in Experience Cloud, Einstein Search, and CMS. Different concept; same word.
Filter controls for CMS content listings. Configured per content type and listing component.
- Facet names are case-sensitive in Visualforce. Header is not the same as header; using the wrong case silently fails.
- Not every Visualforce parent accepts facets. Check the component reference before assuming a slot exists.
- Visualforce is legacy for new development. New work should use Lightning Web Components with slots, not apex:facet.
- Search facets and Visualforce facets share the word but not the concept. Confusing them is common; clarify which is meant in design discussions.
Trust & references
Straight from the source - Salesforce's reference material on Facet.
- apex:facet ReferenceSalesforce Developers
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. Who would typically configure or interact with Facet?
Q2. What best describes the purpose of Facet in Salesforce?
Q3. Which Salesforce Cloud is Facet most closely associated with?
Discussion
Loading discussion…