class Primer::HiddenTextExpander

Use ‘HiddenTextExpander` to indicate and toggle hidden text.

def call

def call
  render(Primer::BaseComponent.new(**@system_arguments)) do
    render(Primer::BaseButton.new(**@button_arguments)) { "…".html_safe }
  end
end

def initialize(inline: false, button_arguments: {}, **system_arguments)

Parameters:
  • system_arguments (Hash) -- <%= link_to_system_arguments_docs %>
  • button_arguments (Hash) -- <%= link_to_system_arguments_docs %> for the button element.
  • inline (Boolean) -- Whether or not the expander is inline.

Other tags:
    Example: Styling the button -
    Example: Inline -
    Example: Default -
def initialize(inline: false, button_arguments: {}, **system_arguments)
  @system_arguments = system_arguments
  @system_arguments[:tag] = :span
  @system_arguments[:classes] = class_names(
    "hidden-text-expander",
    @system_arguments[:classes],
    "inline" => inline
  )
  @button_arguments = button_arguments
  @button_arguments[:"aria-expanded"] = false
  @button_arguments[:classes] = class_names(
    "ellipsis-expander",
    button_arguments[:classes]
  )
end