Heroicons V1

0 views
Skip to first unread message

Elenor Waas

unread,
Aug 4, 2024, 10:22:39 PM8/4/24
to unenduider
havingthose in some external directory and the need to update them constantly

feels like going back to the old icon-library woes i had with fontawesome

and the like in js/ruby/php land years ago.


I am 100% certain that the new default provides better user experiences. Upgrading the icons is the only downside, but that rarely happens, and it is as easy as dropping a zip file. In any case, we are looking into streamlining it, potentially with a mix task.


With this said, I understand the change for performance reasons, but like Kobrakai says, it would be nicer for it to be an external package with an easy way to update the icons, be it with new releases or in place with a mix script (what we have now but with the added script).

If Phoenix Components provides the Icon Component Function one could easily use different icon packages and still reap the performance benefits of this method.


Yes, I understand. Just bear in mind that there is no official package for heroicons. There are react and vue ones, with extra stuff in them, but not one with only icons (not even for npm). So someone would need to do the work (automatized or not) of converting new heroicons release and publishing that into packages.


So all of this, given the fact heroicons itself just tells you to download the whole thing, makes me a bit skeptical the package infrastructure is necessary here. Nonetheless, upgrades could be easier.


Through Tailwind plugin that registers a class with svg data inlined in a css inside a class instead of html. It watches for anything starting with hero- and ending with all possible variations of files.


I created a sample Phoenix app and checked the code to Github. However, I omitted vendor/heroicons and thought I could re-generate the icon files, but when I launched the app mix phx.server I keep getting this error


When attempting to remove blade-ui-kit/blade-icons composer said that the removal failed because blade-ui-kit/blade-heroicons requires it - however, upon inspection it was actually removed and the icons seemed to work anyways. I also attempted to add it back and it still works in that case too.


The heroicons GitHub page has you covered with a package - npm install @heroicons/react (or your favourite package manager of choice) then import them as easy as import BeakerIcon from '@heroicons/react/solid', your icons can now be used like React components in your project.


All methods take the following arguments:string $classnames = '', ?int $width = 24, ?int $height = 24, array $attributes = []All parameters are optional, and change the class , width and height attributes of the SVG element, or add additional HTML attributes.


For example if you want to use a newer Heroicons package than the one shipped with Hyv, you can place the files in your theme at Hyva_Theme/web/svg/heroicons/solid and Hyva_Theme/web/svg/heroicons/outline. For new icons you will not have IDE autocompletion but you can use the methods anyways (Magic! ?).


Heroicons React is a library of beautiful hand-crafted SVG icons designed specifically for React applications. These icons, created by the makers of Tailwind CSS, offer developers a set of scalable and customizable icons that can be easily integrated into their projects.


The heroicons react library has gained popularity due to its simplicity and the quality of icons it provides. With the rise of React as a dominant framework, having a dedicated set of icons that can be imported individually has become essential. These icons are not only visually appealing but also optimized for performance, making them a go-to choice for many developers.


In React, heroicons react serves as a versatile tool to enhance user interfaces. Whether it's for navigation menus, buttons, or form elements, these icons can be easily integrated into any React component, providing a polished look and feel to the app.


The basic usage of heroicons react involves installing the package via npm and then importing the desired icons into your React components. Each icon can be imported as a React component and customized with props for size, color, and additional CSS classes.


Yes, heroicons react is free to use. The icons are MIT licensed, which means they can be used in both personal and commercial projects without any cost. This license also encourages the community to contribute to the library, ensuring that it continues to grow and improve over time.


Being MIT licensed, heroicons react is not only free but also open for anyone's willingness to contribute. The library's repository is publicly available, and the maintainers are accepting contributions, whether it's adding new icons or fixing bugs.


While heroicons react is designed for React, the icons can also be used directly in HTML. Each icon is available as an SVG file, which can be embedded into HTML pages. This makes it possible to use heroicons react even outside of React projects.


For those using Tailwind CSS, heroicons react integrates seamlessly. The icons complement the utility-first approach of Tailwind, allowing developers to style the icons using Tailwind's classes directly within their React components.


While heroicons react is a popular choice, there are other frameworks and libraries available that offer similar functionality. Some developers might be interested in exploring alternatives that provide a different aesthetic or additional icons not found in the heroicons react library.


When comparing heroicons react with other frameworks, it's important to consider factors such as the number of icons, design consistency, and ease of use. Some alternatives might offer more extensive libraries or different styles that better suit a particular project's needs.


Hero icons are a set of SVG icons designed to be simple, scalable, and easy to customize. The design philosophy behind these icons emphasizes clarity and readability, ensuring that they work well in a variety of UI contexts.


Heroicons react offers two styles of icons: solid icons and outline icons. Solid icons are filled and work well for primary actions, while outline icons are more subtle and suitable for secondary actions. Both styles are included in the heroicons react library, providing developers with a range of options for their interfaces.


Hero icons are absolutely free, which makes them an attractive choice for developers working on projects with budget constraints. The heroicons react library allows you to create a visually consistent and professional-looking app without incurring additional costs for icon assets.


The heroicons react library is not only free but also supported by a vibrant community. The makers of Tailwind CSS are open to accepting contributions, which means that new icons and fixes for bugs are continually added. This community-driven approach ensures that the library stays up-to-date and relevant.


To use hero icons in your React app, you need to follow a few simple steps. First, you'll need to install the heroicons react package using npm or yarn. Then, you can import the icons you need and use them as React components within your app.


Customizing hero icons in your React component is straightforward. You can adjust the size, color, and other properties by passing props to the icon component. This allows you to tailor the icons to fit the design of your app perfectly.


There are several other icon libraries that offer aesthetics and functionality similar to heroicons react. Libraries such as Feather, Material Icons, and Font Awesome provide a wide range of icons that can be used in React applications.


Integrating icons from libraries similar to heroicons react into React applications is usually as simple as the integration of Heroicons. Most of these libraries offer React components or can be used with SVG imports, making them versatile options for developers.


For those interested in creating their own library of icons, heroicons react can serve as a solid foundation. You can extend the existing library by adding your own icons, ensuring they match the style and quality of Heroicons.


Managing icon states and dynamic properties is crucial for interactive elements in your app. With heroicons react, you can easily change icon styles based on user interaction or application state, enhancing the user experience.


To optimize performance, it's best to import icons individually rather than importing the entire heroicons react library. This reduces the bundle size of your app and ensures that only the icons that are actually used are included in your final build.


When using heroicons react, it's important to ensure that your icons are accessible. This means providing appropriate alternative text for screen readers and ensuring that the icons are perceivable to users with visual impairments.


If you encounter incorrect TypeScript types or other bugs while using heroicons react, you can fix these issues by contributing to the library or reporting them to the maintainers. The community around heroicons react is active in fixing bugs and improving the library.


Keeping your heroicons react installation up to date is crucial for accessing new icons and bug fixes. You can update the package using npm or yarn, and if you're interested in contributing to the repository, you can fork it on GitHub and submit pull requests with your improvements.


The future of heroicons react looks promising, with ongoing development driven by community involvement. The maintainers are continually adding support for new icons and improvements. This, coupled with the library's MIT license, encourages a collaborative environment where anyone can contribute.


In conclusion, heroicons react is a versatile and valuable resource for any React developer. Its integration with Tailwind CSS, the variety of solid icons and outline icons, and the ease of customization make it an excellent choice for enhancing the user interface of your next project. With the library's commitment to quality and open-source ethos, heroicons react is set to remain a staple in the React developer's toolkit.

3a8082e126
Reply all
Reply to author
Forward
0 new messages