Comments (7)
0.3.1 is published on hex.pm!
from heroicons_elixir.
FWIW, I'd been hoping to do something like this:
defp some_component(assigns) do
~H"""
<.icon_component icon={&Heroicons.Solid.lightning_bolt/1} text="Something" />
"""
end
defp icon_component(assigns) do
~H"""
<%= @icon.(class: "h-4 w-4 ...") %> <%= @text %>
"""
end
But getting lots of warnings.
from heroicons_elixir.
I think you make a good point @soundmonster @joefreeman I'll cut a new version without the warnings
from heroicons_elixir.
I deprecated the function versions of the components in favor of the Phoenix components - which achieves what your icon wrapper does
You can now use <Heroicons.Outline.foo>
as a Phoenix component in your code directly
I noted this in the readme but this is a good nudge to keep a change log and make the deprecation warning tell you what to do
Keeping this issue to track that
from heroicons_elixir.
Oh! That's my bad for not reading better. Thanks for pointing that out and thanks for the quick response! <3
from heroicons_elixir.
I deprecated the function versions of the components in favor of the Phoenix components - which achieves what your icon wrapper does
You can now use
<Heroicons.Outline.foo>
as a Phoenix component in your code directlyI noted this in the readme but this is a good nudge to keep a change log and make the deprecation warning tell you what to do
Keeping this issue to track that
Thanks for the response. I have a minor doubt: what if we want to reuse common class, it seems not easy to wrap <Heroicons.Outline.foo> in a new component.
from heroicons_elixir.
Having a way to parameterize the icon was very handy and feels like a valid use case, e.g. for generating navigation links.
from heroicons_elixir.
Related Issues (11)
- Shamelessly copy for Phosphor? HOT 4
- Support for Heroicons v2 and mini
- Need a way to configure `view-box` and `fill` HOT 2
- Allow `outline` attribute HOT 1
- Dynamic icons HOT 1
- Missing icon HOT 2
- This package prevents using Phoenix Live View 0.19 HOT 6
- Add support for components HOT 1
- Mix script to update SVGs from Github HOT 7
- Specify the stroke-width of the path HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heroicons_elixir.