salla-social

Renders a list of icon links to the store's social media accounts, read from the store settings (store.social).

Renders a list of icon links to the store's social media accounts, read from the store settings (store.social). Accounts without a value, and whatsapp, are skipped. Use it in a theme footer or header. Built-in icons exist for instagram, twitter, facebook, youtube, snapchat and tiktok.

Use it

In HTML or JSX, use the tag <salla-social> with the Attribute names below. In React, the wrapper takes the Property names (camelCase).

import { SallaSocial } from '@salla.sa/twilight-components-react/social';

Client-only. On the server this wrapper renders a placeholder (a skeleton, or nothing), and the real component mounts in the browser. Do not rely on it for content that search engines must see.

Try it

web-components/salla-social

Example

import { SallaSocial } from '@salla.sa/twilight-components-react/social';

export function Example() {
  return (
    <SallaSocial />
  );
}
import { SallaSocial } from '@salla.sa/twilight-components-react/social';

export function Example() {
  return (
    <SallaSocial>
      <a slot="social-item" href="{link}" target="_blank" rel="noopener" aria-label="{type}">{'{'}icon{'}'}</a>
    </SallaSocial>
  );
}

Slots

SlotDescription
social-itemTemplate used for every account. The element is read once at start-up, its inner HTML is repeated for each account and then the element is removed. In the template, {icon} is replaced by the icon SVG, {type} by the network name (for example instagram) and {link} by the account URL. Without it, a link with the icon and an aria-label is used.

On this page