---
schema_version: "1"
id: 54fb25a7f88eec73932d3f4eb40092df5b8ede6cadfb41ba83608208a2826e1c
title: Writing Documentation for the Component Library
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/docs/docs-intro.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/docs-intro.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7482fd63a5d1218d9f125a41294b9270d4d7577488e0e3bbac3797cebb9c06fa
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# Writing Documentation for the Component Library

Documentation helps developers use your components to develop their apps more effectively. You can provide interactive examples, documentation, and specification descriptions for a component, event, or interface.

Each component, event, or interface has a root definition that defines the element’s metadata, as well as attributes, events, or methods.

## Component

A component’s root definition is specified in the `<aura:component>` tag contained in componentName.cmp, as described in [Component Markup](https://developer.salesforce.com/docs/platform/aura-platform/components/components-markup.md).

## Event

An event’s root definition is specified in the `<aura:event>` tag contained in componentEvent.evt, as described in [Create Custom Component Events](https://developer.salesforce.com/docs/platform/aura-platform/events/events-component-create.md).

## Interface

An interface’s root definition is specified in the `<aura:interface>` tag contained in the interfaceName.intf, as described in [Interfaces](https://developer.salesforce.com/docs/platform/aura-platform/oo/oo-interfaces.md).

The root definition tag determines whether the element is exposed in the [Component Library](https://developer.salesforce.com/docs/platform/aura-platform/components/component-library.md). You provide the documentation for each element in an .auradoc file that accompanies the other files that define the component, event, or interface.

## Viewing the Documentation

View the Component Library through your org at https://_MyDomainName_.my.salesforce.com/docs/component-library. Alternatively, view the unauthenticated Component Library at https://developer.salesforce.com/docs/component-library/.

For namespaces that you own, elements with either `access="global"` or `access="public"`(default) are surfaced in the Component Library when it’s accessed through your org.

In the unauthenticated Component Library, only the elements with `access="global"` are visible.

For managed package namespaces, only elements with `access="global"` are surfaced in the Component Library. Elements with `access="public"` can be used only by components in the same namespace in the same org. They aren’t available to other orgs that install the package, so they aren’t surfaced in the Component Library. Only global components in managed packages are visible because they are intended for use in any namespace in any org.

Each element can display up to three tabs in the following order.

### Example

Displays interactive examples denoted by the `<aura:example>` tag in the `.auradoc` file. This tab is hidden if no examples are wired up in your `.auradoc` file. This tab is not supported if your component has dependency on org data, such as with `lightning:recordForm`.

### Documentation

Displays the content of the `.auradoc` file. This tab is hidden if an `.auradoc` file is not available for your component, event, or interface.

### Specification

Displays the description of the root definition, attributes, and methods. For namespaces you own, attributes and methods with either `access="global"` or `access="public"`(default) are surfaced in the Component Library when it’s accessed through your org. For managed package namespaces, only `access="global"` attributes and methods are visible.

- **[Creating Examples](https://developer.salesforce.com/docs/platform/aura-platform/guide/docs-examples.md)**


    Examples are interactive and help others learn about a component, event, or interface.

- **[Creating Documentation Content](https://developer.salesforce.com/docs/platform/aura-platform/guide/docs-auradoc.md)**


    Documentation provides usage guidelines and code samples about a component, event, or interface.

- **[Providing Specification Information and Descriptions](https://developer.salesforce.com/docs/platform/aura-platform/guide/docs-specs.md)**


    Descriptions on the **Specification** tab describes a root definition and its attributes and methods.

**See Also**

- [Controlling Access](https://developer.salesforce.com/docs/platform/aura-platform/access/access-intro.md)
