studiometa / ui

📦 A set of opiniated, unstyled and accessible components
https://ui.studiometa.dev/-/
MIT License
9 stars 1 forks source link

A molecule for social media icons management #158

Open antoine4livre opened 7 months ago

antoine4livre commented 7 months ago

Idea of parameters :

{% set links = [
  { name: 'x', url: 'https://x.com/user' },
  { name: 'instagram', url: 'https://instagram.com/user' },
  { name: 'youtube', url: 'https://youtube.com/user' },
] %}

It will output every social media icons in a link element with title, href, target, rel attributes.

antoine4livre commented 7 months ago

An update for the API:

{% include '@ui/molecules/SocialIcons/SocialIcons.twig' with {
  x: 'https://x.com/user',
  instagram: 'https://instagram.com/user',
  youtube: 'https://youtube.com/user',
} only %}

Keys are the icons' names and are reed programmatically.

What do you think about @titouanmathis ?

titouanmathis commented 7 months ago

The API is good for me 👍