class Primer::Beta::Truncate

Use ‘Truncate` to shorten overflowing text with an ellipsis.

def before_render

def before_render
  return unless content.present? && items.empty?
  with_item { content }
end

def initialize(**system_arguments)

Parameters:
  • system_arguments (Hash) -- <%= link_to_system_arguments_docs %>
def initialize(**system_arguments)
  @system_arguments = system_arguments
  @system_arguments[:tag] = system_arguments[:tag] || :span
  @system_arguments[:classes] = class_names(
    "Truncate",
    system_arguments[:classes]
  )
end

def render?

def render?
  items?
end