class Primer::Beta::Blankslate
-
The blankslate can leverage the spinner component, which will communicate to screen reader users that the content is still loading.
- ‘secondary_action` text should be meaningful out of context and clearly describe the destination. Avoid using vague text like, “Learn more” or “Click here”.
- The blankslate supports a primary and secondary action. Both actions have been built as semantic links with primary and secondary styling.
- All blankslate visuals have been programmed as decorative images, using `aria-hidden=”true”` and `img alt=””`, which will hide the visual from screen reader users.
- The blankslate uses a semantic heading that must be set at the appropriate level based on the hierarchy of the page.
@accessibility
Use `Blankslate` when there is a lack of content within a page or section. Use as placeholder to tell users why something isn’t there.
def initialize(narrow: false, spacious: false, border: false, **system_arguments)
-
system_arguments
(Hash
) -- <%= link_to_system_arguments_docs %> -
border
(Boolean
) -- Adds a border around the Blankslate. -
spacious
(Boolean
) -- Increases the padding from `32px` to `80px 40px`. -
narrow
(Boolean
) -- Adds a maximum width of `485px` to the Blankslate.
def initialize(narrow: false, spacious: false, border: false, **system_arguments) @border = border @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:tag] = :div @system_arguments[:classes] = class_names( @system_arguments[:classes], "blankslate", "blankslate-narrow": narrow, "blankslate-spacious": spacious ) end
def render?
def render? heading.present? end
def wrapper
def wrapper unless @border yield return # returning `yield` caused a double render end content_tag(:div, class: "Box") do yield if block_given? end end