Social Widget Web Component

Note: This example demonstrates the custom web component for the social feed widget. Replace the placeholder token with a real authentication token for your user. See the Widgets Docs Index for theming and embed attributes.
Authentication Required: The social widget requires a valid JWT token to display the feed and enable commenting functionality.

Grid Layout (Public)

<legion-social layout="grid" rows="2" cols="3" width="600" height="400" api-url="${window.location.origin}" community-url="${window.location.origin}/community" channel="general"></legion-social>

4x2 Grid Example (8 items):

<legion-social layout="grid" rows="2" cols="4" width="800" height="400" api-url="${window.location.origin}" community-url="${window.location.origin}/community" channel="announcements"></legion-social>

Feed Layout (Authenticated)

<legion-social layout="feed" auth-token="your-jwt-token" width="600" height="800" channel="general" api-url="${window.location.origin}"></legion-social>

Integration Code

1. Include the Widget Script

<script src="${window.location.origin}/js/social-widget.js"></script>

2. Add the Widget to Your Page

<legion-social api-url="${window.location.origin}" width="600" height="800"> </legion-social>

3. Widget Attributes

Features

Authentication

The social widget requires a valid JWT token for the full feed layout. The grid layout is public and only displays images.

Styling

You can customize the widget container with CSS:

social-widget { border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); overflow: hidden; }