Sha256: 99f84e81e2db4498ac9dd50df0c3533e535e5db01f6ae579e36b4a15cd0c03b4

Contents?: true

Size: 1.45 KB

Versions: 3

Compression:

Stored size: 1.45 KB

Contents

<%= render(Primer::OpenProject::PageHeader.new) do |component| %>
  <% component.with_title do %>
    Great news
  <% end %>
  <% component.with_description do %>
    This example lists all possible actions of a PageHeader. Of course, you will most likely never need all of them on the same page as it is shown here.
  <% end %>
  <% component.with_breadcrumbs([{ href: "/foo", text: "Foo" }, { href: "/bar", text: "Bar" }, "Baz"]) %>
  <% component.with_action_text { "An additional hint" } %>
  <% component.with_action_link(mobile_icon: "link", mobile_label: "Community", href: "https://community.openproject.com", target: "_blank") { "Go to community" } %>
  <% component.with_action_button(mobile_icon: "star", mobile_label: "Star") do |button|%>
      <% button.with_leading_visual_icon(icon: "star") %>
      Star
  <% end %>
  <% component.with_action_button(mobile_icon: nil, mobile_label: nil) { "Hide on mobile" } %>
  <% component.with_action_icon_button(icon: "trash", mobile_icon: "trash", label: "Delete", scheme: :danger) %>
  <% component.with_action_menu(menu_arguments: { anchor_align: :end }, button_arguments: { icon: "op-kebab-vertical", "aria-label": "Some actions" })  do |menu, button| %>
    <% menu.with_item(label: "Subitem 1") do |item| %>
      <% item.with_leading_visual_icon(icon: :paste) %>
    <% end %>
    <% menu.with_item(label: "Subitem 2") do |item| %>
      <% item.with_leading_visual_icon(icon: :log) %>
    <% end %>
  <% end %>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
openproject-primer_view_components-0.26.0 previews/primer/open_project/page_header_preview/actions.html.erb
openproject-primer_view_components-0.25.1 previews/primer/open_project/page_header_preview/actions.html.erb
openproject-primer_view_components-0.25.0 previews/primer/open_project/page_header_preview/actions.html.erb