Class: DesignSystem::Generic::StartButtonComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- DesignSystem::Generic::StartButtonComponent
- Defined in:
- app/components/design_system/generic/start_button_component.rb
Overview
The "start a service" CTA. GOV.UK defined the pattern and NHS adopted it unchanged — both brands ship identical markup with only the brand-derived CSS prefix differing, so the implementation lives here.
Direct Known Subclasses
DesignSystem::Govuk::StartButtonComponent, Nhsuk::StartButtonComponent
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text, href, options = {}) ⇒ StartButtonComponent
constructor
A new instance of StartButtonComponent.
Methods included from Helpers::CssHelper
Methods included from BrandDerivable
Constructor Details
#initialize(text, href, options = {}) ⇒ StartButtonComponent
Returns a new instance of StartButtonComponent.
7 8 9 10 11 12 |
# File 'app/components/design_system/generic/start_button_component.rb', line 7 def initialize(text, href, = {}) super() @text = text @href = href @options = .merge('data-module': "#{brand}-button") end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
14 15 16 |
# File 'app/components/design_system/generic/start_button_component.rb', line 14 def href @href end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'app/components/design_system/generic/start_button_component.rb', line 14 def @options end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
14 15 16 |
# File 'app/components/design_system/generic/start_button_component.rb', line 14 def text @text end |