We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be cool to be able to pass a component as the slot name, allowing easier composition of shared markup.
Now
defmodule TempleExampleWeb.Components.LinkList do import Temple.Component defcomp Item do a class: "text-blue-500 hover:underline", href: @url do slot :default end end render do for {social, url} <- @socials do li do span do slot :link, url: url, text: social end end end end end # usage c LinkList, socials: @user.socials do slot :link, %{text: text, url: url} do c LinkList.Item, url: url do text end end end
Then
defmodule TempleExampleWeb.Components.LinkList do import Temple.Component defcomp Item do a class: "text-blue-500 hover:underline", href: @url do slot :default, text: @text end end render do for {social, url} <- @socials do li do span do slot LinkList.Item, url: url, text: social end end end end end # usage c LinkList, socials: @user.socials do slot LinkList.Item, %{text: text} do text end end
Something like that at least
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be cool to be able to pass a component as the slot name, allowing easier composition of shared markup.
Now
Then
Something like that at least
The text was updated successfully, but these errors were encountered: