Previews

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<%# With Subhead Actions %>
<%= render(Primer::Beta::Subhead.new) do |component| %>
<% component.with_heading(id: "scLabel-vert") { "File view" } %>
<% component.with_description(id: "scCaption-vert") { "Change the way the file is viewed" } %>
<% component.with_actions do %>
<%= render(Primer::Alpha::SegmentedControl.new("aria-labelledby": "scLabel-vert", "aria-describedby": "scCaption-vert")) do |component| %>
<% component.with_item(label: "Preview", selected: true) %>
<% component.with_item(label: "Raw") %>
<% component.with_item(label: "Blame") %>
<% end %>
<% end %>
<% end %>
<%# With Label And Caption %>
<%= render(Primer::Box.new(display: :flex, direction: :column)) do %>
<%= render(Primer::BaseComponent.new(tag: "span", id: "scLabel-horiz")) { "File view" } %>
<%= render(Primer::Alpha::SegmentedControl.new("aria-labelledby": "scLabel-horiz", "aria-describedby": "scCaption-horiz")) do |component| %>
<% component.with_item(label: "Preview", selected: true) %>
<% component.with_item(label: "Raw") %>
<% component.with_item(label: "Blame") %>
<% end %>
<%= render(Primer::Beta::Text.new(font_size: :small, mt: 1, color: :muted, id: "scCaption-horiz")) { "Change the way the file is viewed" } %>
<% end %>