Class: Ariadne::HeaderComponent
- Defined in:
- app/components/ariadne/header_component.rb
Overview
Represents the top navigation bar on every page.
Constant Summary collapse
- DEFAULT_CLASSES =
"ariadne-sticky ariadne-top-0 ariadne-z-50 ariadne-px-4 ariadne-py-5 ariadne-bg-white ariadne-shadow-sm shadow-slate-900/5 ariadne-transition ariadne-duration-500"- LINK_CLASSES =
ariadne-flex ariadne-flex-wrap ariadne-items-center ariadne-justify-between ariadne-bg-white dark:ariadne-shadow-none dark:ariadne-bg-transparent
"ariadne-rounded-lg ariadne-py-1 ariadne-px-2 text-slate-700 hover:bg-slate-100 hover:text-slate-900"- DEFAULT_TEXT_LOGO_CLASSES =
"ariadne-flex ariadne-items-center ariadne-font-bold ariadne-text-xl"- DEFAULT_IMAGE_LOGO_CLASSES =
"ariadne-h-10 ariadne-w-auto"- DEFAULT_NAV_LINK_CLASSES =
Text within the header, representing navigation.
"ariadne-inline-block ariadne-rounded-lg ariadne-py-1 ariadne-px-2 ariadne-text-sm text-slate-700 hover:bg-slate-100 hover:text-slate-900"- DEFAULT_SIGNUP_LINK_CLASSES =
Text within the header, representing a signup.
"group ariadne-inline-flex ariadne-items-center ariadne-justify-center ariadne-rounded-full ariadne-py-2 ariadne-px-4 ariadne-text-sm ariadne-font-semibold focus:ariadne-outline-none focus-visible:outline-2 focus-visible:outline-offset-2"- DEFAULT_PROFILE_LINK_CLASSES =
"group ariadne-inline-flex ariadne-items-center ariadne-justify-center ariadne-rounded-full ariadne-py-2 ariadne-px-4 ariadne-text-sm ariadne-font-semibold focus:ariadne-outline-none focus-visible:outline-2 focus-visible:outline-offset-2"
Constants inherited from Component
Component::BASE_BODY_CLASSES, Component::BASE_HTML_CLASSES, Component::BASE_MAIN_CLASSES, Component::BASE_WRAPPER_CLASSES, Component::INVALID_ARIA_LABEL_TAGS
Constants included from ActionViewExtensions::FormHelper
ActionViewExtensions::FormHelper::DEFAULT_FORM_CLASSES
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::INTEGER_TYPES, FetchOrFallbackHelper::InvalidValueError, FetchOrFallbackHelper::TRUE_OR_FALSE
Instance Method Summary collapse
-
#initialize(classes: "", attributes: {}) ⇒ HeaderComponent
constructor
<%= render(Ariadne::HeaderComponent.new) do |header| %> <%= header.logo(as_text: true) { “GitHub” } %> <%= header.navigation_link(href: “#features”) { “Features” } %> <%= header.login_link(href: “/login”) { “Login” } %> <% end %>.
Methods included from ActionViewExtensions::FormHelper
Methods included from ClassNameHelper
Methods included from LoggerHelper
#logger, #silence_deprecations?, #silence_warnings?
Methods included from FetchOrFallbackHelper
#check_incoming_attribute, #check_incoming_tag, #check_incoming_value, #fetch_or_raise, #fetch_or_raise_boolean, #fetch_or_raise_integer
Constructor Details
#initialize(classes: "", attributes: {}) ⇒ HeaderComponent
<%= render(Ariadne::HeaderComponent.new) do |header| %>
<%= header.logo(as_text: true) { "GitHub" } %>
<%= header.navigation_link(href: "#features") { "Features" } %>
<%= header.login_link(href: "/login") { "Login" } %>
<% end %>
85 86 87 88 89 90 91 92 |
# File 'app/components/ariadne/header_component.rb', line 85 def initialize(classes: "", attributes: {}) @classes = class_names( DEFAULT_CLASSES, classes, ) @attributes = attributes end |