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
How to change favicon? #6155
Comments
Here's my setup. First in
Then in
Then in
Hope that helps! |
My bad, I meant |
Solution I figured out to replace the default
I believe it works because it's copying the static directory files to the site root which overwrites the favicon.ico, but it could be some other dark magic I tried the manager-head.html solution but it was outputting the html into the body instead of the head. Not sure it that's a bug in v6.4.19 or if that's expected |
@shilman approach didn't help in my case nor @seantomlins's approach (for some reason) I ended up doing this hack in // manager.js
import favicon from './assets/favicon.ico';
const link = document.createElement('link');
link.setAttribute('rel', 'shortcut icon');
link.setAttribute('href', favicon);
document.head.appendChild(link); |
# Pull Request ## 🤨 Rationale The favicon in the Storybook site was non existent. Updating it to the Nimble icon. Used this information to help direct me to updating it: [How to change favicon? (Storybook GitHub)](storybookjs/storybook#6155) [Reference example from the MS Fluent Storybook Repo](https://github.com/microsoft/fluentui/blob/4c970883a796505b132b356aa03302c068eb0ea9/packages/web-components/.storybook/manager-head.html) I think this replaces this closed pull request: #217 ## 👩💻 Implementation - Added ICO and PNG versions of the Nimble Icon - Created an HTML file to reference them as the favicon - Updated the npm command 'storybook' to add the image files directory ## 🧪 Testing Ran storybook locally to make sure it displays the favicon correctly. <img width="871" alt="image" src="https://user-images.githubusercontent.com/109235103/187926080-0cedfec7-ea43-4453-a316-69f36ba0ddbf.png"> <img width="481" alt="image" src="https://user-images.githubusercontent.com/109235103/187926268-c222d54b-1eb6-420c-8d09-b249e8b5f368.png"> ## ✅ Checklist - [x ] I have updated the project documentation to reflect my changes or determined no changes are needed.
Thanks @sag1v , this was the only solution that worked for me. |
I'm using Storybook v7 and @seantomlins solution works fine! |
Just rename the file that you want to show as favicon to |
I second with @soumitya0 solution, this works for version |
I struggled to achieve this. I manage to do it by :
|
Describe the bug
We are unable to set a custom favicon for the storybook static build and development. We've tried using HtmlWebpackPlugin, setting the icon with different urls in the
preview-header.html
andmanager-header.html
having imported the 'favicon.ico' in theconfig.js
as follows:And the
preview-header.html
(ormanager-header.html
):We've tried these routes too:
And
Using the first option we see that the favicon is broken, however we don't see in the bundle the favicon.
System:
The text was updated successfully, but these errors were encountered: