Responsive

Renders content selectively based on the viewport size.

Read more Read less

Useful in situations where responsiveness can not be totally encapsulated in individual components.

Either the ‘from’ or the ‘upto’ attribute is required.

Examples

<.responsive from="md">
  <.table id="users" rows={@users}>
<!-- this will be rendered as a table component with rows -->

  </.table>
<./responsive>

<.responsive upto="md">
  <.table id="users" rows={@users}>
<!-- this will be rendered as a set of card components -->

  <./table>
<./responsive>

Resize your screen to observe the responsive rendering logic.

From 'sm' up to 'lg'

This box of text is shown from 560px to 1023px.

It is not shown on screens 559px or narrower, nor on screens 1024px or wider.

From 'md' up to 'xl'

This box of text is shown from 744px to 1439px.

It is not shown on screens 743px or narrower, nor on screens 1440px or wider.

All examples hidden!

All examples hidden!

Attribute Type Documentation Default Value
class :any

user-provided class

[]
from :string
upto :string
rest :global
tag :string "div"
Required inner_block * :slot
[Multiple values]