AttRibutes
Social Share
What is this page about?

Attributes, by Finsweet, offers a free series of Solutions that provide essential features to improve your Webflow websites.

Social Share

Create buttons to share content on X, Facebook, Telegram, Linkedin and more.

Social Share • Flash Card

Copy Script

For advanced users familiar with this solution. Includes all attributes from this page. Click on attributes and values to copy them.

Required attributes

Chose trigger and platform first

Trigger + Platform

Add to Link Block, text Link, text Element, Div Block

Value: X, Facebook, Pinterest, LinkedIn, Telegram, Reddit

fs-socialshare-element
=
"
PLATFORM_NAME
"

For all platforms

URL

Add to text Block, Heading, Paragraph, Text Link
If absent, the system defaults to using the URL of the current page for social sharing.

fs-socialshare-element
=
"
url
"

Platform-specific content

X, formerly known as Twitter - Content

Add to Text Block, Heading, Paragraph

fs-socialshare-element
=
"
content
"

X, formerly known as Twitter - Username

Add to Text Block, Text Link, Heading, Paragraph

fs-socialshare-element
=
"
x-username
"

X, formerly known as Twitter - Hashtag

Add to Text Block, Text Link, Heading, Paragraph

fs-socialshare-element
=
"
x-hashtag
"

Facebook - Hashtag

Add to Text Block, Text Link, Heading, Paragraph

fs-socialshare-element
=
"
facebook-hashtags
"

Pinterest - Image

Add to Image

fs-socialshare-element
=
"
pinterest-image
"

Pinterest - Description

Add to Text Block, Heading, Paragraph

fs-socialshare-element
=
"
pinterest-description
"

Reddit - Content

Add to Text Block, Heading, Paragraph

fs-socialshare-element
=
"
content
"

Telegram - Content

Add to Text Block, Heading, Paragraph

fs-socialshare-element
=
"
content
"

Linkedin

There are no options for Linkedin

Optional attributes

Width

Add to Trigger + Platform element

fs-socialshare-width
=
"
VALUE_IN_PX
"

height

Add to Trigger + Platform element

fs-socialshare-height
=
"
VALUE_IN_PX
"
1

Add this <script> inside the <head> tag of your page or project

This script is the universal Attribute script: you only need to include it once, even if you have multiple Attribute solutions on the page. Learn more .

<script async type="module"
src="https://cdn.jsdelivr.net/npm/@finsweet/attributes@2/attributes.js"
fs-socialshare
></script>

Copy Script
2

Choose the social media you want:

3

Add this required attribute to the element

X Trigger

The trigger element for sharing
fs-socialshare-element
=
"
x
"

This element acts as the button to start the social sharing process. Clicking on this element presents the user with options for sharing content on social media.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
x
Copy
Add it to those type(s) of element(s):
Link Block
Link
Text Element
Div Block
NOTE

This trigger will share the current URL by default. If you want to share a specific URL, use the 'Custom URL' option below.

4

Publish your project! Done, easy right?

Check more elements and settings below
Optional

Add more

elements

Share Custom URL

The URL for the social share
fs-socialshare-element
=
"
url
"

This element creates a URL for sharing on social media, using either text from a CMS or static content.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
url
Copy
Add it to those type(s) of element(s):
Paragraph
Link
Text Block
Heading

Content

The content for the social share
fs-socialshare-element
=
"
content
"

This element designates the text that will be shared on social media. The actual text to be shared is taken from the content of a Text Element, Paragraph, or Heading.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
content
Copy
Add it to those type(s) of element(s):
Text Block
Heading
Paragraph

Username

The username tag of the share
fs-socialshare-element
=
"
twitter-username
"

This element creates Twitter usernames from text content, such as "@finsweet."

Add this attribute:
Name
fs-socialshare-element
Copy
Value
twitter-username
Copy
Add it to those type(s) of element(s):
Text Block
Text Link
Heading
Paragraph

Hashtag

The hashtag for the social share
fs-socialshare-element
=
"
twitter-hashtag
"

This element produces Twitter hashtags from text content, like "#BuiltWithAttributes."

Add this attribute:
Name
fs-socialshare-element
Copy
Value
twitter-hashtag
Copy
Add it to those type(s) of element(s):
Text Block
Text Link
Heading
Paragraph
3

Add this required attribute to the element

Facebook Trigger

The trigger element for sharing
fs-socialshare-element
=
"
facebook
"

This element acts as the button to start the social sharing process. Clicking on this element presents the user with options for sharing content on social media.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
facebook
Copy
Add it to those type(s) of element(s):
Link Block
Link
Text Element
Div Block
NOTE

This trigger will share the current URL by default. If you want to share a specific URL, use the 'Custom URL' option below.

4

Publish your project! Done, easy right?

Check more elements and settings below
Optional

Add more

elements

Share Custom URL

The URL for the social share
fs-socialshare-element
=
"
url
"

This element creates a URL for sharing on social media, using either text from a CMS or static content.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
url
Copy
Add it to those type(s) of element(s):
Paragraph
Link
Text Block
Heading

Hashtag

The hashtag for the social share
fs-socialshare-element
=
"
facebook-hashtag
"

This element produces Twitter hashtags from text content, like "#BuiltWithAttributes."

Add this attribute:
Name
fs-socialshare-element
Copy
Value
facebook-hashtag
Copy
Add it to those type(s) of element(s):
Text Block
Text Link
Heading
Paragraph
3

Add these required attributes to the elements

Pinterest Trigger

The trigger element for sharing
fs-socialshare-element
=
"
pinterest
"

This element acts as the button to start the social sharing process. Clicking on this element presents the user with options for sharing content on social media.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
pinterest
Copy
Add it to those type(s) of element(s):
Link Block
Link
Text Element
Div Block
NOTE

This trigger will share the current URL by default. If you want to share a specific URL, use the 'Custom URL' option below.

4

Publish your project! Done, easy right?

Check more elements and settings below
Optional

Add more

elements

Share Custom URL

The URL for the social share
fs-socialshare-element
=
"
url
"

This element creates a URL for sharing on social media, using either text from a CMS or static content.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
url
Copy
Add it to those type(s) of element(s):
Paragraph
Link
Text Block
Heading

Image

The source image for the share
fs-socialshare-element
=
"
pinterest-image
"

This element creates a Pinterest image for sharing based on the text content. When applied to an image element in Webflow, the source of the image (src) is used for social sharing.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
pinterest-image
Copy
Add it to those type(s) of element(s):
Image

Description

fs-socialshare-element
=
"
pinterest-description
"

This element generates a Pinterest description based on text content.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
pinterest-description
Copy
Add it to those type(s) of element(s):
Text Block
Heading
Paragraph
3

Add this required attribute to the element

Reddit Trigger

The trigger element for sharing
fs-socialshare-element
=
"
reddit
"

This element acts as the button to start the social sharing process. Clicking on this element presents the user with options for sharing content on social media.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
reddit
Copy
Add it to those type(s) of element(s):
Link Block
Link
Text Element
Div Block
NOTE

This trigger will share the current URL by default. If you want to share a specific URL, use the 'Custom URL' option below.

4

Publish your project! Done, easy right?

Check more elements and settings below
Optional

Add more

elements

Share Custom URL

The URL for the social share
fs-socialshare-element
=
"
url
"

This element creates a URL for sharing on social media, using either text from a CMS or static content.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
url
Copy
Add it to those type(s) of element(s):
Paragraph
Link
Text Block
Heading

Content

The content for the social share
fs-socialshare-element
=
"
content
"

This element designates the text that will be shared on social media. The actual text to be shared is taken from the content of a Text Element, Paragraph, or Heading.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
content
Copy
Add it to those type(s) of element(s):
Text Block
Heading
Paragraph
3

Add this required attribute to the element

Telegram Trigger

The trigger element for sharing
fs-socialshare-element
=
"
telegram
"

This element acts as the button to start the social sharing process. Clicking on this element presents the user with options for sharing content on social media.

The attribute value specifies the social media platform to be opened for sharing.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
telegram
Copy
Add it to those type(s) of element(s):
Link Block
Link
Text Element
Div Block
NOTE

This trigger will share the current URL by default. If you want to share a specific URL, use the 'Custom URL' option below.

4

Publish your project! Done, easy right?

Check more elements and settings below
Optional

Add more

elements

Share Custom URL

The URL for the social share
fs-socialshare-element
=
"
url
"

This element creates a URL for sharing on social media, using either text from a CMS or static content.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
url
Copy
Add it to those type(s) of element(s):
Paragraph
Link
Text Block
Heading

Content

The content for the social share
fs-socialshare-element
=
"
content
"

This element designates the text that will be shared on social media. The actual text to be shared is taken from the content of a Text Element, Paragraph, or Heading.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
content
Copy
Add it to those type(s) of element(s):
Text Block
Heading
Paragraph
3

Add this required attribute to the element

Linkedin Trigger

The trigger element for sharing
fs-socialshare-element
=
"
linkedin
"

This element acts as the button to start the social sharing process. Clicking on this element presents the user with options for sharing content on social media.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
linkedin
Copy
Add it to those type(s) of element(s):
Link Block
Link
Text Element
Div Block
NOTE

This trigger will share the current URL by default. If you want to share a specific URL, use the 'Custom URL' option below.

4

Publish your project! Done, easy right?

Check more elements and settings below
Optional

Add more

elements

Share Custom URL

The URL for the social share
fs-socialshare-element
=
"
url
"

This element creates a URL for sharing on social media, using either text from a CMS or static content.

Add this attribute:
Name
fs-socialshare-element
Copy
Value
url
Copy
Add it to those type(s) of element(s):
Paragraph
Link
Text Block
Heading
Optional

Add more

settings

Width

Width of the social media popover window
fs-socialshare-width
=
"
VALUE_IN_PX
"

Width of the social share popup.

Add this attribute:
Name
fs-socialshare-width
Copy
Value
VALUE_IN_PX
Copy
Example:
fs-socialshare-width = "450"
Add it to any element with
fs-socialshare-element = "PLATFORM_NAME"
script icon
Script tag

Height

Height of the social media popover window
fs-socialshare-height
=
"
VALUE_IN_PX
"

Height of the social share popup.

Add this attribute:
Name
fs-socialshare-height
Copy
Value
VALUE_IN_PX
Copy
Example:
fs-socialshare-height = "250"
Add it to any element with
fs-socialshare-element = "PLATFORM_NAME"
script icon
Script tag
Optional

Add more

Instances

Define an instance on a common parent wrapper

fs-socialshare-instance
=
"
IDENTIFIER
"

If you wish to create multiple instances of this solution on the same page, please follow the steps below:

  1. Select a wrapper parent that contains all the elements of an instance.
  2. Add an -instance attribute to it, with a unique value.
  3. Repeat for every instance.
Add this attribute:
Name
fs-socialshare-instance
Copy
Value
IDENTIFIER
Copy
Examples:
fs-socialshare-instance = "1"
fs-socialshare-instance = "2"
fs-socialshare-instance = "blog"
fs-socialshare-instance = "team"
Learn more ways to set up multiple instances and how it works

Still need help?