bitcrowd / bitstyles_phoenix

A collection of Elixir phoenix helpers for bitstyles
ISC License
12 stars 0 forks source link

Add component: description list #52

Closed andreasknoepfle closed 2 years ago

andreasknoepfle commented 2 years ago

https://bitcrowd.github.io/bitstyles/?path=/docs/ui-data-description-list--description-list

Maybe as ui_dl with slots? Or ui_description_list

Something like this:

<.ui_description_list>
  <:item label="Created at">12.12.2020</:item>
</.ui_description_list>

If no label is provided one could interpret the inner content as raw:

<.ui_description_list>
  <:item>
    <.ui_description_list_dt>My label</.ui_description_list_dt>
     <.ui_description_list_dd>My value</.ui_description_list_dd>
  </:item>
</.ui_description_list>

Alternative:

<.ui_description_list>
  <.ui_description_list_item label="My label">
     My value
  </.ui_description_list_item>
</.ui_description_list>

and

<.ui_description_list>
  <.ui_description_list_item>
    <:dt>My label</:dt>
     <:dd>My value</:dd>
  </.ui_description_list_item>
</.ui_description_list>