Class: DesignSystem::Govuk::Builders::Tab
- Inherits:
-
DesignSystem::Generic::Builders::Tab
- Object
- DesignSystem::Generic::Builders::Base
- DesignSystem::Generic::Builders::Tab
- DesignSystem::Govuk::Builders::Tab
- Defined in:
- lib/design_system/govuk/builders/tab.rb
Overview
This class provides GOVUK Tab.
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from DesignSystem::Generic::Builders::Base
Methods included from Helpers::CssHelper
Methods included from DesignSystem::Generic::Builders::Concerns::BrandDerivable
Constructor Details
This class inherits a constructor from DesignSystem::Generic::Builders::Base
Instance Method Details
#render_tabs {|@tab| ... } ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/design_system/govuk/builders/tab.rb', line 8 def render_tabs @tab = ::DesignSystem::Components::Tab.new(self) yield @tab content_tag(:div, class: "#{brand}-tabs", 'data-module': "#{brand}-tabs") do safe_buffer = ActiveSupport::SafeBuffer.new safe_buffer.concat(content_tag(:h2, @tab.title, class: "#{brand}-tabs__title")) if @tab.title safe_buffer.concat(tabs_list_content) if @tab.tabs.present? safe_buffer.concat(tabs_body_content) if @tab.tabs.present? safe_buffer end end |