defmodule <%= @module_name %>Web.Components.BentoGrid do use Phoenix.Component @moduledoc """ Bento grid component with bento cards. See `bento_card/1` for usage. Whitelist col_start, col_end, row_start, row_end. """ attr(:class, :string, default: "", doc: "CSS class for parent div") slot(:inner_block, required: true) def bento_grid(assigns) do ~H"""
<%%= render_slot(@inner_block) %>
""" end attr(:name, :string, required: true) attr(:description, :string, required: true) attr(:icon, :string, default: "hero-trophy", doc: "Hero-icon name") attr(:col_start, :integer, default: 1) attr(:col_end, :integer, default: 3) attr(:row_start, :integer, default: 1) attr(:row_end, :integer, default: 1) attr(:class, :string, default: "", doc: "CSS class for parent div") slot(:background, required: false) slot(:inner_block, required: true) def bento_card(assigns) do ~H"""
<%%= render_slot(@background) %>

<%%= @name %>

<%%= @description %>

<%%= render_slot(@inner_block) %>
""" end end