diff --git a/lib/salad_ui/collapsible.ex b/lib/salad_ui/collapsible.ex index f74d525..187d4af 100644 --- a/lib/salad_ui/collapsible.ex +++ b/lib/salad_ui/collapsible.ex @@ -47,14 +47,17 @@ defmodule SaladUI.Collapsible do Render trigger for collapsible component. """ attr(:class, :string, default: nil) + attr :rest, :global slot(:inner_block, required: true) + def collapsible_trigger(assigns) do ~H""" <.dynamic tag="button" onclick={exec_closest("phx-toggle-collapsible", ".collapsible-root")} class={@class} + {@rest} > <%= render_slot(@inner_block) %> diff --git a/lib/salad_ui/sidebar.ex b/lib/salad_ui/sidebar.ex index 7f85aaa..ccab778 100644 --- a/lib/salad_ui/sidebar.ex +++ b/lib/salad_ui/sidebar.ex @@ -367,6 +367,7 @@ defmodule SaladUI.Sidebar do TODO: class merge not work well here """ attr(:class, :string, default: nil) + attr :as, :any attr(:rest, :global) slot(:inner_block, required: true)