defmodule PetalComponents.Breadcrumbs do use Phoenix.Component import PetalComponents.Icon alias PetalComponents.Link attr(:separator, :string, default: "slash", values: ["slash", "chevron"]) attr(:class, :any, default: nil, doc: "Parent div CSS class") attr(:separator_class, :any, default: nil, doc: "Separator div CSS class") attr(:link_class, :any, default: nil, doc: "Link class CSS") attr(:links, :list, default: [], doc: "List of your links") attr(:aria_label, :string, default: "Breadcrumbs", doc: "ARIA label for the nav") attr(:rest, :global) # Example: # <.breadcrumbs separator="chevron" # class="mt-3" # link_class="!text-blue-500 text-sm font-semibold" # links={[ # %{ label: "Link 1", to: "/" }, # %{ to: "/", icon: :home, icon_class="text-blue-500" }, # %{ label: "Link 1", to: "/", link_type: "patch|a|redirect" } # ]} # /> def breadcrumbs(assigns) do ~H""" """ end defp separator(%{type: "slash"} = assigns) do ~H""" """ end defp separator(%{type: "chevron"} = assigns) do ~H"""
<.icon name="hero-chevron-right-solid" aria-hidden="true" class="pc-breadcrumbs__separator-chevron__icon" />
""" end end