---
schema_version: "1"
id: 0a30eba6fac8475ef153cd81762f395d5a4d86344ae8ed2d04aeb6b9a17d17ca
title: Visualforce Components
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/pages_custom_components.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.pages_custom_components.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f34196b6ce9713425d5d4dca19d9a5d52f1486f80a346cf9317e4e8540667765
description: Visualforce components are small, reusable pieces of functionality—think widgets, panels, user interface elements, that kind of thing—that you use in Visualforce page markup. You can use standard Visualforce components, and create your own custom components.
products:
  - Salesforce Platform
release: "264"
---
# Visualforce Components

Visualforce components are small, reusable pieces of functionality—think widgets, panels, user interface elements, that kind of thing—that you use in Visualforce page markup. You can use standard Visualforce components, and create your own custom components.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Contact Manager</strong>, <strong>Group</strong>, <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

Salesforce provides a library of standard, pre-built components, such as `<apex:relatedList>` and `<apex:dataTable>`, that can be used to develop Visualforce pages. In addition, you can build your own custom components to augment this library.

A custom component encapsulates a common design pattern that can be reused in one or more Visualforce pages. It consists of:

- A set of Visualforce markup demarcated by the `<apex:component>` tag
- An optional component controller written in Apex that allows the component to perform additional logic, such as sorting items in a list, or calculating values

For example, suppose you want to create a photo album using Visualforce pages. Each photo in the album has its own border color, and a text caption that displays beneath it. Rather than repeating the Visualforce markup required for displaying every photo in the album, you can define a custom component named `singlePhoto` that has attributes for image, border color, and caption, and then uses those attributes to display the image on the page. Once defined, every Visualforce page in your organization can leverage the `singlePhoto` custom component in the same way as a page can leverage standard components such as `<apex:dataTable>` or `<apex:relatedList>`.

Unlike page templates, which also enable developers to reuse markup, custom components provide more power and flexibility because:

- Custom components allow developers to define attributes that can be passed in to each component. The value of an attribute can then change the way the markup is displayed on the final page, and the controller-based logic that executes for that instance of the component. This behavior differs from that of templates, which do not have a way of passing information from the page that uses a template to the template's definition itself.
- Custom component descriptions are displayed in the application's component reference dialog alongside standard component descriptions. Template descriptions, on the other hand, can only be referenced through the Setup area of Salesforce because they are defined as pages.

- **[Defining Visualforce Custom Components](https://help.salesforce.com/s/articleView?id=platform.pages_custom_components_create.htm&release=264.0.0&type=5)**  
    Visualforce components are small, reusable pieces of functionality—think widgets, panels, user interface elements, that kind of thing—that you use in Visualforce page markup. You can use standard Visualforce components, and create your own custom components.
- **[View and Edit Visualforce Custom Components](https://help.salesforce.com/s/articleView?id=platform.pages_custom_components_edit.htm&release=264.0.0&type=5)**  
    A custom component encapsulates a common design pattern that can be reused in one or more Visualforce pages.
- **[Manage Visualforce Custom Components](https://help.salesforce.com/s/articleView?id=platform.pages_custom_components_manage.htm&release=264.0.0&type=5)**  
    After creating custom components, you can view, edit and delete them.
- **[Visualforce Component Limits](https://help.salesforce.com/s/articleView?id=platform.pages_limits.htm&release=264.0.0&type=5)**  
    Limits for Visualforce components and pages.

#### See Also

- [Defining Visualforce Custom Components](https://help.salesforce.com/s/articleView?id=platform.pages_custom_components_create.htm&release=264.0.0&type=5 "Visualforce components are small, reusable pieces of functionality—think widgets, panels, user interface elements, that kind of thing—that you use in Visualforce page markup. You can use standard Visualforce components, and create your own custom components.")
- [View and Edit Visualforce Custom Components](https://help.salesforce.com/s/articleView?id=platform.pages_custom_components_edit.htm&release=264.0.0&type=5 "A custom component encapsulates a common design pattern that can be reused in one or more Visualforce pages.")