You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
We frequently use basic components like
Link
,Button
, orIcon
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 aButton
instead.Button
– Consumers may want to customize the behavior of theButton
, or turn it into aLink
instead.Icon
– A lot of components will have anicon
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?<Icon/>
and it will load the custom SVG sprites. If we convertIconName
into a TypeScriptinterface
then type checking can be done throughinterface
extension.The text was updated successfully, but these errors were encountered: