-
Notifications
You must be signed in to change notification settings - Fork 16
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
format-api-f14b86: Document how and where the icon is being imported #101
Comments
Thanks for your feedback on this example @skorasaurus To change the icon of the Note I think all components with an Here's an example of how you can change the icon of
In the example above, the icon prop is set to
As it states here the Read more about Slot and Fills in the Block Editor Handbooks' SlotFills Reference or the Extending plugins using custom SlotFills article in the Developer blog I agree there's a lot of room for improvement in the docs, so please open an issue at https://github.com/WordPress/gutenberg/issues for any improvement you consider should be done in the docs, so actions can be taken from there. |
@skorasaurus I think we can close this issue. What do you think? |
@juanmaguitar thanks for following up and for the very detailed reply. I was a bit frustrated when I filed the issue and will file an issue in gutenberg to propose that RichTextToolbarButton has its props (or parameters?) documented. I'll propose and credit you for writing: |
I followed along the example of the Format API and but I was dumbfounded because I couldn't figure out how the icon was being imported and needed to import different one.
Action item:
Explicitly mention how the icon is being imported in the tutorial (or if the approach that I did more common, maybe include that )
Other buttons in the format bar were calling it in by importing WordPress' Icons package but that's not called in the format-api-f14b86 example.
I eventually figured out to import an existing WordPress icon by:
npm install @wordpress/icons --save
),import { commentReplyLink } from "@wordpress/icons";
List of icons is available at the storybookicon={commentReplyLink}
unlike the example which in format-api-f14b86 which brings in a text string.(for anyone else finding this: if you wanted to import your own, you probably could do it through through https://wordpress.github.io/gutenberg/?path=/docs/components-icon--docs
Relatedly, the richtexttoolbarbutton component (which appears to be a wrapper or abstraction?) is could have its documentation improved by although that should go in the gutenberg repository; since all that exists is the example in the rich-text readme and a separate reference in https://github.com/WordPress/gutenberg/tree/1eb76440f7b86ca905ac875d4a2c6ed67fc48daf/packages/block-editor which says it's undocumented.
The text was updated successfully, but these errors were encountered: