chrisvaillancourt / website

Topher's personal website.
https://chrisvaillancourt.io/
0 stars 0 forks source link

feat(components/icon): add title slot #55

Open chrisvaillancourt opened 1 year ago

chrisvaillancourt commented 1 year ago

TLDR

Replace the name prop with a title slot.

Summary

The icon component uses a name prop to populate the <title> element's content.

We should remove the name prop and add a title slot <slot name="title">. This approach makes it the component more declarative and allows us to only render the <title> if content is passed into the title slot.

chrisvaillancourt commented 1 year ago

Also look into refactoring how title works.

For example, if we have an icon within a button, we want the title to appear when hovering the button instead of the icon within the button.