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.
A component’s root definition is specified in the <aura:component> tag contained in componentName.cmp, as described in Component Markup.
An event’s root definition is specified in the <aura:event> tag contained in componentEvent.evt, as described in Create Custom Component Events.
An interface’s root definition is specified in the <aura:interface> tag contained in the interfaceName.intf, as described in Interfaces.
The root definition tag determines whether the element is exposed in the Component Library. You provide the documentation for each element in an .auradoc file that accompanies the other files that define the component, event, or interface.
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.
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.
Displays the content of the .auradoc file. This tab is hidden if an .auradoc file is not available for your component, event, or interface.
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.
-
Examples are interactive and help others learn about a component, event, or interface.
-
Creating Documentation Content
Documentation provides usage guidelines and code samples about a component, event, or interface.
-
Providing Specification Information and Descriptions
Descriptions on the Specification tab describes a root definition and its attributes and methods.
See Also