Embed Components: Lemmy
This component allows you to embed Fediverse posts from Lemmy.
It supports both dark and light themes, and will automatically adjust based on the theme of the site. You can give it a try on this page by toggling the theme, using the button in the top right corner.
It is versatile, letting you choose which elements of the post to display, and how many lines of text to show for the title and excerpt. There is also support for an optional header card, which can be used to provide context for the embedded content.
Demo
If a post is deleted or removed, or otherwise inaccessible, the component will display the following message:
Usage
Similar to the other card components
- You can call a header card for the container
- You can specify the number of lines to display for the card title and card excerpt
- You can also hide certain elements of the card.
Basic Usage:
<EmbedLemmy
:links="[
'https://lemmy.ca/post/6890347',
]"
/>
Which will display the following
Props
links
- An array of Lemmy post URLs to embed.- Hide props:
hideUser
- Hide the user who posted the content.hideCommunity
- Hide the community the content was posted in.hideTitle
- Hide the title of the posthideBanner
- Hide the image in the post. This includes image posts, as well as thumbnails for link posts.hideExcerpt
- Hide the text from the post bodyhideScore
- Hide the score of the post (net number of upvotes)hideComments
- Hide the number of comments on the posthideDate
- Hide the date the post was created
- Header Bar:
headerTitle
- The title of the header cardHeaderTitleLines
- The number of lines to display for the header titleheaderDate
- The date in the header cardheaderLink
- A link for the header card
titleLines
- The number of lines to display for the titleexcerptLines
- The number of lines to display for the excerpt
Here is a silly example using all the props, where only the banner is displayed:
<EmbedLemmy
:links="[
'https://lemmy.ca/post/6890347',
]"
:hideUser="true"
:hideCommunity="true"
:hideTitle="true"
:hideBanner="false"
:hideExcerpt="true"
:hideScore="true"
:hideComments="true"
:hideDate="true"
headerTitle="A silly example using all the props"
headerTitleLines="2"
headerDate="2025-01-27"
headerLink="https://example.com"
:titleLines="2"
:excerptLines="3"
/>