class Primer::Beta::Flash
Use ‘Flash` to inform users of successful or pending actions.
def initialize(full: false, spacious: false, dismissible: false, icon: nil, scheme: DEFAULT_SCHEME, **system_arguments)
-
system_arguments
(Hash
) -- <%= link_to_system_arguments_docs %> -
scheme
(Symbol
) -- <%= one_of(Primer::Beta::Flash::SCHEME_MAPPINGS.keys) %> -
icon
(Symbol
) -- Name of Octicon icon to use. -
dismissible
(Boolean
) -- Whether the component can be dismissed with an X button. -
spacious
(Boolean
) -- Whether to add margin to the bottom of the component. -
full
(Boolean
) -- Whether the component should take up the full width of the screen.
def initialize(full: false, spacious: false, dismissible: false, icon: nil, scheme: DEFAULT_SCHEME, **system_arguments) @icon = icon @dismissible = dismissible @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:tag] = :div @system_arguments[:classes] = class_names( @system_arguments[:classes], "flash", SCHEME_MAPPINGS[fetch_or_fallback(SCHEME_MAPPINGS.keys, scheme, DEFAULT_SCHEME)], "flash-full": full ) @system_arguments[:mb] ||= spacious ? 4 : nil end