-
Notifications
You must be signed in to change notification settings - Fork 730
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
feature idea: custom axis tick label component #259
Comments
I just saw that This helps a lot, but I still think |
Good ideas! Happy to add both in an upcoming release. Better docs will be coming as well. |
Nice! Do you want me to make a PR? |
Go for it! Would love to land a PR for this |
added in #260 |
Currently the styling options for axis tick labels with
@vx/axis
are quite limited since they just render a<text />
element. For my use case I need multi line tick labels and some more control over the those.Idea
Use
@vx/text
to render tick labels.This would enable labels to wrap and have multiline support without making the implementation too complex and I think the current API would not have any breaking changes.
Add a
tickComponent
propThis would enable the user to have full control over the axis tick labels. The prop would accept a function that takes some arguments for positioning.
With that approach you could for example render a text and a little icon next to it or anything really. One could also render
<Text />
from@vx/text
. Adding thetickComponent
prop would just call the provided function instead of the default<text />
element. This would also not break the existing API.Example:
I'm happy to discuss other options and provide a PR if this is a feature
@vx/axis
should have.These ideas could be implemented for the axis label aswell.
The text was updated successfully, but these errors were encountered: