🚨 You are viewing the legacy v1.x docs. See the new v2 documentation →
v1.5.5

PreviewGroup

Represents a group of examples within a preview.

Attributes

.label

Label for the group, used in navigation

Type: String
.url_path

URL of the group in Lookbook

Type: String
.type

The entity type. Returns :group

Type: Symbol

Methods

.tags

Returns an array of Tag objects for the group

Groups cannot have tags set on themselves directly so the tags are the result of merging the tags of all examples in the group together.

If no tag type is provided then all tags are returned.

group.tags(<tag_type?>)
<tag_type?>

Optional tag type to filter by - e.g. :todo

Type: Symbol
<ul id="todo-list">
  <% group.tags(:todo).each do |todo| %>
    <li><%= todo.task %></li>
  <% end %>
</ul>