Tab
A tab button to be used inside a tabs component
Sage Component
SageTab
<h3 class="t-sage-heading-6">As a button with a target pane in mind</h3>
<%= sage_component SagePanelBlock, {} do %>
<%= sage_component SageTab, {
target: "example-tab1",
text: "Page 1",
}
%>
<% end %>
<h3 class="t-sage-heading-6">As a button and icon with a target pane in mind</h3>
<%= sage_component SagePanelBlock, {} do %>
<%= sage_component SageTab, {
target: "example-tab2",
text: "Page 1",
icon: "pen"
}
%>
<% end %>
<h3 class="t-sage-heading-6">As a link with a route or site in mind</h3>
<%= sage_component SagePanelBlock, {} do %>
<%= sage_component SageTab, {
attributes: {
href: "//example.com",
},
text: "Page 1"
}
%>
<% end %>
<h3 class="t-sage-heading-6">As a link with a route and icon</h3>
<%= sage_component SagePanelBlock, {} do %>
<%= sage_component SageTab, {
attributes: {
href: "//example.com",
},
text: "Page 1",
icon: "pen"
}
%>
<% end %>
Property | Description | Type | Default |
---|---|---|---|
|
Toggles |
Boolean |
|
|
For setting additional attributes not defined above. Accepts a Ruby hash of valid key-value properties, such as data-attributes |
Hash |
|
|
Sets the state to "disabled" by default. |
Boolean |
|
|
Provides the name of the Sage Icon to be displayed before the text content. |
String |
|
|
Provides the |
String |
|
|
Sets the content of the text. |
String |
|