Skip to content

docs(icons): enhance icon picker documentation and add search component #283

New issue

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions docs/advanced/icons/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,33 @@ tags:
- Icon repositories
---

import { IconSearch } from '/src/components/IconSearch.tsx';

## Icon picker
Icons in Homarr are automatically requested from multiple sources:
- [Walkxcode Dashboard icons](https://github.com/walkxcode/dashboard-icons)
- [Dashboard Icons](https://dashboardicons.com/) - Our recommended source with over 1888+ curated, high-quality icons
- [selfh.st icons](https://github.com/selfhst/icons)
- [Simple icons](https://github.com/simple-icons/simple-icons)
- [Tabler icons](https://tabler-icons.io/)
- [Papirus icons](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme)
- [Homelab Svg assets](https://github.com/loganmarchione/homelab-svg-assets)
- **Local icons**: automatically fetched from the [medias feature](/docs/management/media/)

Using these icon sources, Homarr provides a total collection over over 11'000 icons at your fingertips.
The icon picker is a fast searcher that helps you to find your desired icon simply by entering search term.
Using these icon sources, Homarr provides a total collection of over 11,000 icons at your fingertips.
The icon picker is a fast searcher that helps you to find your desired icon simply by entering a search term.

### Finding Missing Icons

If you can't find the icon you're looking for in Homarr's built-in picker, we strongly recommend checking [Dashboard Icons](https://dashboardicons.com/). It offers a modern, user-friendly interface and a curated collection of high-quality icons specifically designed for dashboards and app directories.

You can search Dashboard Icons directly using the search box below:

<IconSearch />

![Icon picker](./img/icon-picker.gif)

Icons, that are high quality and printable ([SVG](https://de.wikipedia.org/wiki/Scalable_Vector_Graphics)) are marked with a red badge "SVG" at the top right.
Icons that are high quality and printable ([SVG](https://wikipedia.org/wiki/Scalable_Vector_Graphics)) are marked with a red badge "SVG" at the top right.

### Using external icons
If you do not wish to upload an icon in Homarr but you also didn't find the icon you're looking for, you can simply enter a URL that points to an icon.
If you don't find the icon you're looking for on Dashboard Icons or wish to use a different source, you can simply enter a URL that points to an icon.
It is important that the URL directly points to the file without any advertisements or elements around it.
24 changes: 24 additions & 0 deletions src/components/IconSearch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { useState } from 'react';

export const IconSearch = () => {
const [searchTerm, setSearchTerm] = useState('');

const handleSubmit = (e: React.FormEvent) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const handleSubmit = (e: React.FormEvent) => {
const handleSubmit = (event: React.FormEvent) => {

e.preventDefault();
if (searchTerm.trim()) {
window.location.href = `https://dashboardicons.com/icons?q=${encodeURIComponent(searchTerm)}`;
}
};

return (
<form onSubmit={handleSubmit} className="mt-4 mb-6">
<input
type="text"
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onChange={(e) => setSearchTerm(e.target.value)}
onChange={(event) => setSearchTerm(event.target.value)}

placeholder="Search for icons on dashboardicons.com..."
className="w-full px-4 py-2 text-gray-700 bg-white border rounded-lg focus:outline-none focus:border-blue-500"
/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix darkmode:
image

</form>
);
};