Documenting Patterns

Pattern documentation gives developers and designers the ability to provide context for their patterns. The documentation file consists of Markdown with YAML front matter. It should follow this format:

title: Title for my pattern
This is a *Markdown* description of my pattern.

Attributes overview:

  • The title attribute is used in Pattern Lab's navigation as well as in the styleguide views. Format: string
  • Pattern tags has to be an array, like tags: [new, relaunch, dev]
  • Pattern states are defined like state: incomplete and provide a simple visual indication

Both tags and states could be used for not including patterns in a UIKit specific build.

The description is used in the styleguide views.

Pattern documentation needs to have a .md file extension and match the name of the pattern it's documenting. For example, to document the following pattern:


We'd name our documentation file:


Documenting Pseudo-Patternspermalink

To add documentation to pseudo-patterns, replace the tilde sign (~) with a dash (-) when naming your documentation file.

For example, to document the following pseudo-pattern:


We'd name our documentation file:


Adding More Attributes to the Front Matterpermalink

A future update of Pattern Lab will support more front matter attributes including: excludeFromStyleguide, order, hidden and links. It will also support adding custom attributes that could be utilized by plugins. For example, GitHub issues related to patterns.