x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<div class=""> <div class="lui-marketplace__item_card lui-marketplace__item_card--vertical"> <div class="lui-marketplace__item_card__image_wrapper" data-controller="item-card-favorite" style="width: 64px;height: 64px;"> <a class="inline" href="#" target="" rel="noopener noreferrer"> <img class="lui-marketplace__item_card__image" src="https://cataas.com/cat" /> </a> <div class="lui-marketplace__item_card__favorite"> <button class="lui-button lui-button--neutral--secondary lui-button--size-small w-fit w-fit" data-controller="lui--button" data-turbo-method="post"> <i class="lui-button__icon lui-button__icon--small fa-regular fa-heart" data-lui--button-target="leadingIcon"></i> </button> </div> </div> <a class="flex w-full flex-col min-w-0 grow-0" href="#" target=""> <span class="lui-marketplace__item_card__name">Item</span> <div class="lui-marketplace__item_card__price">123,00 €</div> </a></div> </div>No Usage documentation to display.
1
2
3
4
5
6
7
8
<% preview_params[:price] = preview_params[:price].to_money with_favorite = preview_params.delete(:with_favorite) preview_params.delete(:size) if preview_params[:size] == ""%><%= render LooposUi::Marketplace::ItemCard.new(**preview_params) do |card| %> <% card.with_favorite_button(tag_options: { data: { turbo_method: :post } }) if with_favorite %><% end %>No notes provided.
| Param | Description | Input |
|---|---|---|
|
— |
|
|
|
— |
|
|
|
— |
|
|
|
— |
|
|
|
— |
|
|
|
— |
|
|
|
— |
|
|
|
— |
|
|
|
— |
|
|
|
— |
|
ItemCard
Description
The ItemCard component is a marketplace item display card that presents item information in a compact, visually appealing format. It displays the item's main image, name, price, and includes a favorite button for user interaction.
Arguments
| Property | Type | Description |
|---|---|---|
item |
Interface | An item object that must implement :name, :main_image, :latest_value_out, :date, :status, and :favorite methods |
name |
String | The title of the item |
image_url |
String | The url of the image to be displayed |
price |
Money | The price Money object |
date |
TDate | The date of the item |
status |
String | The status of the item |
favorite |
Bool | Whether the item is favorited (default: false) |
size |
TSize | The size of the card |
orientation |
Symbol | The orientation of the card (:horizontal or :vertical, default: :vertical) |
href |
String | If present, will wrap both the image and the text in an anchor link |
data |
Hash | Data attributes on the wrapper element |
You must pass in either an item or name, image_url and price.
Slots
Renders One
favorite_button- A customizable favorite button that renders as a button with a heart icon by default