## Overview

This document offers a brief conceptual overview of Components and the
Component Framework.

In Fuchsia, *[](https://fuchsia.dev/docs/glossary#component)* is the term for the common
abstraction that defines how all software^[1](https://fuchsia.dev/fuchsia-src/concepts/components/v2/introduction#fn1)^ (regardless of source,
programming language, or runtime) is described, sandboxed, and executed on a
Fuchsia system.

### What is sandboxing?

Sandboxing is a security mechanism to isolate programs from each other at
runtime. In Fuchsia, all software is sandboxed. When a program is initially
created, it does not have the ability to do anything -- not even to allocate
memory. The program relies on its creator to provide the capabilities needed
for it to execute. This isolation property allows Fuchsia to employ the
*principle of least privilege*: programs are provided only the minimal set
of capabilities needed to execute.

## Component Framework

The Component Framework (CF) consists of the core concepts, tools, APIs,
runtime, and libraries necessary to describe and run components and to
coordinate communication and access to resources between components.

The Component Framework includes:

- CF concepts, including *component* , *component manifest* , *runner* , *realm* , *environment* , *capabilities* , and *resolver*.
- The [`component_manager`](https://fuchsia.dev/docs/concepts/components/v2/component_manager) process, which coordinates the communication and sharing of resources between components.
- [FIDL APIs](https://fuchsia.dev/fuchsia-src/concepts/components/v2/introduction#fidl-apis) implemented by `component_manager`, or implemented by other components and used by `component_manager`, for the purposes of coordination.
- Developer tools to build, execute, and test components.
- Language-specific libraries for components to use to interact with the system. ([example](https://cs.opensource.google/fuchsia/fuchsia/+/main:/sdk/lib/sys))
- Testing tools and libraries to write unit and integration tests that exercise one or many components. ([example](https://fuchsia.dev/docs/development/testing/components/realm_builder))

## Capabilities

Since Fuchsia is a capability-based operating system, components interact with
each other through the use of *[](https://fuchsia.dev/docs/glossary#capability)*.
A capability combines access to a resource and a set of rights, providing both a
mechanism for access control and a means by which to interact with the resource.

To support the complex composition of software present in today's products, the
Component Framework provides distinct [capability types](https://fuchsia.dev/docs/concepts/components/v2/capabilities/README) built
upon Zircon


[](https://fuchsia.dev/docs/glossary#kernel-object)


.
A common representation of a capability is a


[](https://fuchsia.dev/docs/glossary#channel)


that
speaks a particular


[](https://fuchsia.dev/docs/glossary#fidl)


protocol.

The Component Framework assembles the *[](https://fuchsia.dev/docs/glossary#namespace)* for a
component using


[](https://fuchsia.dev/docs/glossary#component-declaration)


that
describe the capabilities the component requires to function.
Components can discover the available capabilities in their namespace using the
[`fuchsia.io.Directory`](https://fuchsia.dev/reference/fidl/fuchsia.io#Directory) protocol.

At runtime, every component receives its namespace as well as a handle to the
server end of a `Directory` channel. This `Directory` channel is called the
the *[](https://fuchsia.dev/docs/glossary#outgoing-directory)*. Through the
outgoing directory, the component's executable makes discoverable any
capabilities that it provides.

The Component Framework brokers discovery from a providing component's
outgoing directory to a consuming component's namespace through a process called
*[](https://fuchsia.dev/docs/glossary#capability-routing)* .
While most capabilities are routed to component instances, *runner* and
*resolver* capabilities are routed to *[](https://fuchsia.dev/docs/glossary#environment)*.
Environments configure the behavior of the framework for the realms to which
they are assigned.

> [!NOTE]
> **Note:** In the Fuchsia process layer, "having a capability" means the process holds a handle to the kernel object capability in its handle table. In the Component Framework, we often use "having a capability" to mean that the capability is discoverable through the component's namespace at runtime.

Further reading:

- [Zircon kernel objects](https://fuchsia.dev/docs/reference/kernel_objects/objects)
- [Component Framework capabilities](https://fuchsia.dev/docs/concepts/components/v2/capabilities/README)
- [Environments](https://fuchsia.dev/docs/concepts/components/v2/environments)

## Components

*Components* are the foundational building blocks of software running in Fuchsia.
Each component is a composable, sandboxed module that interacts with other
components through capabilities.

At its core, a component consists of the following:

- A [](https://fuchsia.dev/docs/glossary#component-url) , which uniquely identifies that component.
- A [](https://fuchsia.dev/docs/glossary#component-manifest) , which describes how to launch the component, as well as any capability routes.

The Component Framework relies on *component resolvers* to retrieve components
from their origin. Resolvers take a component URL as an input and produce a
component manifest and (optionally) an access mechanism to the bytes of a
software package as output.

Components that include an executable program may specify any runtime
(such as a raw process or a virtual machine) provided to the Component Framework
through a *[](https://fuchsia.dev/docs/glossary#runner)*. Runners consume parts of the
manifest and the package, and provide the component's binary with a way to
execute.

> [!NOTE]
> **Note:** Components without an executable program may still route capabilities and host children, but no code will be executed for the component.

Resolvers and runners are themselves capabilities and interact directly with the
framework to extend its functionality. Components can implement these
capabilities to add support for new component origins and runtimes.

> [!NOTE]
> **Note:** To bootstrap the system, `component_manager` includes a built-in resolver, the `boot-resolver`, which resolves `fuchsia-boot://` URLs to manifests on the boot image, as well as a built-in runner, the ELF runner, which executes ELF binaries stored in signed Fuchsia packages.

Further reading:

- [Component manager](https://fuchsia.dev/docs/concepts/components/v2/component_manager)
- [Resolver capability](https://fuchsia.dev/docs/concepts/components/v2/capabilities/resolver)
- [Runner capability](https://fuchsia.dev/docs/concepts/components/v2/capabilities/runner)
- [Fuchsia packages](https://fuchsia.dev/docs/concepts/packages/package)

### Composition

A component together with its children are referred to as a
*[](https://fuchsia.dev/docs/glossary#realm)* .
The collective


[](https://fuchsia.dev/docs/glossary#parent-component-instance)


and


[](https://fuchsia.dev/docs/glossary#child-component-instance)


relationships of all individual
components are referred to as the
*[](https://fuchsia.dev/docs/glossary#component-instance-tree)* .
A *[](https://fuchsia.dev/docs/glossary#moniker)* is a topological path that identifies a specific
component instance within a component instance tree. You will often see
monikers represented as POSIX-like path strings.

*[](https://fuchsia.dev/docs/glossary#component-topology)* is the term for the
component instance tree and the collective capability routes over that tree.

Further reading:

- [Component topology](https://fuchsia.dev/docs/concepts/components/v2/topology)
- [Realms](https://fuchsia.dev/docs/concepts/components/v2/realms)

### Lifecycle

Components move through the following lifecycle states:

- Discovered
- Started
- Stopped
- Destroyed

Components are discovered either a) by virtue of being statically declared as a
child of another component in a component manifest, or b) by being added to a


[](https://fuchsia.dev/docs/glossary#component-collection)


at runtime. Similarly,
components are destroyed implicitly by being removed from the list of static
children in a component manifest, or explicitly by being removed from a
component collection at runtime.

When a component is started or stopped, `component_manager` coordinates with
the appropriate runner to execute or terminate the component's executable.

Further reading:

- [Component lifecycle](https://fuchsia.dev/docs/concepts/components/v2/lifecycle)

[](https://issues.fuchsia.dev/issues/new?component=1439230&template=1881640&description=Issue+on:+https://fuchsia.dev/docs/concepts/components/v2/introduction.md "Report a bug or suggest improvements on this page") [](https://cs.opensource.google/fuchsia/fuchsia/+/main:docs/concepts/components/v2/introduction.md "View the source code of this page") [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/concepts/components/v2/introduction.md&cloneRepo=fuchsia/fuchsia:refs/heads/main&fullPath=fuchsia/docs/concepts/components/v2/introduction.md "Edit the source code of this page")

*** ** * ** ***

1. With the exception of early-boot software necessary to run components. [↩](https://fuchsia.dev/fuchsia-src/concepts/components/v2/introduction#fnref1)