---
schema_version: "1"
id: ac5d42b9c2e51cfdd3a3a2dfc416d80987d21da21dd4fcec6548d963c9743c64
title: Component Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_pages_dynamic_components.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_pages_dynamic_components.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 92f1c9eee5e63d89fa0f616937fad7df5d65174a7e77473a5a702cc16cb9d882
description: Represents a dynamic Visualforce component in Apex.Returns a reference to the child components for the component.Sets the content of an attribute using the expression language notation. The notation for this is expressions.name_of_attribute.Sets the content of a facet to a dynamic component. The notation is facet.name_of_facet.
---
# Component Class

Represents a dynamic Visualforce component in Apex.

## Namespace

[ApexPages](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_ApexPages.htm "The ApexPages namespace provides classes used in Visualforce controllers.")

## Dynamic Component Properties

The following are properties for Component.

- **[childComponents](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_pages_dynamic_components.htm#apex_ApexPages_Component_childComponents)**  
    Returns a reference to the child components for the component.
- **[expressions](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_pages_dynamic_components.htm#apex_ApexPages_Component_expressions)**  
    Sets the content of an attribute using the expression language notation. The notation for this is expressions.name\_of\_attribute.
- **[facets](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_pages_dynamic_components.htm#apex_ApexPages_Component_facets)**  
    Sets the content of a facet to a dynamic component. The notation is facet.name\_of\_facet.

### childComponents

Returns a reference to the child components for the component.

#### Signature

public List <ApexPages.Component> childComponents {get; set;}

#### Property Value

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[ApexPages.Component](#apex_pages_dynamic_components "Represents a dynamic Visualforce component in Apex.")\>

#### Example

Component.Apex.PageBlock pageBlk = new Component.Apex.PageBlock();

Component.Apex.PageBlockSection pageBlkSection = new Component.Apex.PageBlockSection(title='dummy header');

pageBlk.childComponents.add(pageBlkSection);

### expressions

Sets the content of an attribute using the expression language notation. The notation for this is expressions.name\_of\_attribute.

#### Signature

public String expressions {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

#### Example

Component.Apex.InputField inpFld = new 
Component.Apex.InputField();
inpField.expressions.value = '{!Account.Name}';
inpField.expressions.id = '{!$User.FirstName}';

### facets

Sets the content of a facet to a dynamic component. The notation is facet.name\_of\_facet.

#### Signature

public String facets {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

#### Usage

![Note](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/images/icon_note.png)

#### Note

This property is only accessible by components that support facets.

#### Example

Component.Apex.DataTable myDT = new 
Component.Apex.DataTable();
Component.Apex.OutputText footer = new 
Component.Apex.OutputText(value='Footer Copyright');
myDT.facets.footer = footer;