View Source BitstylesPhoenix.Component.Content (bitstyles_phoenix v2.3.1)

The Content component.

Summary

Functions

Renders a content div, to add some spacing to the sides of your content.

Functions

Renders a content div, to add some spacing to the sides of your content.

Attributes

  • variant — Variant of the content you want, from those available in the CSS classes e.g. full
  • class - Extra classes to pass to the content. See BitstylesPhoenix.Helper.classnames/1 for usage.
  • All other attributes are passed to the div tag.

See bitstyles content docs for examples, and for the default variants available.

Default content

iex> assigns = %{}
...> render ~H"""
...> <.ui_content>
...>   Content
...> </.ui_content>
...> """
"""
<div class="a-content">
  Content
</div>
"""

Full content

iex> assigns = %{}
...> render ~H"""
...> <.ui_content variant="full">
...>   Full Content
...> </.ui_content>
...> """
"""
<div class="a-content a-content--full">
  Full Content
</div>
"""

Extra classes and attributes

iex> assigns = %{}
...> render ~H"""
...> <.ui_content variant="full" class="u-h2" data-foo="bar">
...>   Content with extra
...> </.ui_content>
...> """
"""
<div class="a-content a-content--full u-h2" data-foo="bar">
  Content with extra
</div>
"""