A


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


is a URL that identifies a component.

This section describes the syntax used for displaying URLs to users.

## URL Format

A component URL can, in principle, have any [scheme](https://tools.ietf.org/html/rfc3986#section-3.1). Some
common schemes you may encounter are:

- [fuchsia-pkg](https://fuchsia.dev/fuchsia-src/reference/components/url#fuchsia-pkg)
- [fuchsia-boot](https://fuchsia.dev/fuchsia-src/reference/components/url#fuchsia-boot)
- [http(s)](https://fuchsia.dev/fuchsia-src/reference/components/url#http)

### fuchsia-pkg

A `fuchsia-pkg` component URL is a [package URL](https://fuchsia.dev/docs/concepts/packages/package_url) that locates a
component distributed in a [Fuchsia package](https://fuchsia.dev/docs/concepts/packages/package).

It has the same format as [package URL](https://fuchsia.dev/docs/concepts/packages/package_url), with a
[resource path](https://fuchsia.dev/docs/concepts/packages/package_url#resource-paths) relative to the package root that
locates a [component manifest](https://fuchsia.dev/docs/concepts/components/v2/component_manifests). This path is usually of the form
`meta/<manifest_name>.cm`.

    fuchsia-pkg://<repo-hostname>[/<pkg-name>[/<pkg-variant>][?hash=<pkg-hash>][#<path-to-manifest>]]

Example:

    fuchsia-pkg://fuchsia.com/stash#meta/stash_secure.cm

### fuchsia-boot

A `fuchsia-boot` component URL locates a component in the system boot image.
This scheme is used to identify components that must be resolved during early
boot before a [`fuchsia-pkg`](https://fuchsia.dev/fuchsia-src/reference/components/url#fuchsia-pkg) [resolver](https://fuchsia.dev/docs/concepts/components/v2/capabilities/resolver) is
available. It has the following format:

    fuchsia-boot:///<path-to-manifest-in-bootfs>

Example:

    fuchsia-boot:///#meta/driver_manager.cm

### http(s)

An `http(s)` component URL identifies a web page as a component. Such a
component could be executed as a web page in a web [runner](https://fuchsia.dev/docs/concepts/components/v2/capabilities/runner), for
example.

Example:

    https://en.wikipedia.org/wiki/Hippos

## Relative URLs

The Component Framework supports a subset of relative URLs (Relative URLs are
defined in [URL RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2)). Specifically, Component Framework
supports relative path URLs (plus a *URL fragment* with the path to the
component manifest) to subpackaged components, and fragment-only URLs.

The path to the component manifest is the only content allowed in a relative
component URL fragment (`#meta/<component>.cm`). If the fragment contains any
other content, or if a relative component includes URL query parameters
(`?key=value`), the component will not resolve.

### Relative path URLs to subpackaged components

A relative path URL is resolved at runtime based on a known "context". For
components resolving a child component by relative URL, the context is a
resolver-supplied value associated with the parent component. The URL `path` is
interpreted as the name of one of the declared


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


s of the parent component's package.

Relative subpackage path URLs start with a
[relative package URL](https://fuchsia.dev/docs/concepts/packages/package#relative-package-urls) and have the following format:

    <subpackage-path>#<path-to-manifest>

Example:

    child#meta/default.cm

For more information on subpackages and subpackaged components, see
the documentation on [Fuchsia Subpackages](https://fuchsia.dev/docs/concepts/components/v2/subpackaging).

### Relative fragment-only URLs

A relative fragment-only URL is resolved at runtime based on the URL of the
parent component's [package](https://fuchsia.dev/docs/concepts/packages/package). Fragment-only URLs have the following
format:

    #<path-to-manifest>

Example:

    #meta/child.cm

For a `fuchsia-pkg` parent component with the following URL:

    fuchsia-pkg://fuchsia.com/package#meta/component.cm

The relative URL resolves to:

    fuchsia-pkg://fuchsia.com/package#meta/child.cm

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