Skip to content
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

Bring Your Own Link/Button/Icon #130

Open
mkrause opened this issue Feb 7, 2025 · 0 comments
Open

Bring Your Own Link/Button/Icon #130

mkrause opened this issue Feb 7, 2025 · 0 comments

Comments

@mkrause
Copy link
Collaborator

mkrause commented Feb 7, 2025

We frequently use basic components like Link, Button, or Icon inside of other components. We currently don't have a standard way to override/customize these components. For example:

  • Link – Consumers will likely want to override this to hook it up to their router library (see also Bring Your Own Router #126). Or turn it into a Button instead.
  • Button – Consumers may want to customize the behavior of the Button, or turn it into a Link instead.
  • Icon – A lot of components will have an icon prop which allows the user to select an icon from Baklava's own icon pack. But what if the consumer wants to use a custom icon that's not in the icon pack?
    • Idea: we could just allow users to inject their SVG sprites into the document under some global ID (maybe prefixed to avoid name clashes). Then, we wouldn't need users to actually inject a custom component, instead they could just keep using <Icon/> and it will load the custom SVG sprites. If we convert IconName into a TypeScript interface then type checking can be done through interface extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant