Social Media
Social Media is a built-in tool that lets users add their social media icons to an email or web page.
Enable / Disable
unlayer.init({
tools: {
social: {
enabled: false,
},
},
});
Default Values
Social Media tool comes with the following default values. You can choose to change any of these.
| Property | Default Value |
|---|---|
| icons | [] |
| spacing | 5 |
| align | center |
| containerPadding | 10px |
Here are a few examples on how to change these default values.
Icons
You can set the social media tool to come with default social networks and their URLs pre-filled.
iconType is optional and defaults to circle. Set it explicitly to choose another style,
such as squared.
unlayer.init({
tools: {
social: {
properties: {
icons: {
value: {
icons: [
{ name: 'Facebook', url: 'https://facebook.com/' },
{ name: 'X', url: 'https://x.com/' },
],
},
},
},
},
},
});
Icon Spacing
unlayer.init({
tools: {
social: {
properties: {
spacing: {
value: 5,
},
},
},
},
});
Alignment
unlayer.init({
tools: {
social: {
properties: {
align: {
value: 'center',
},
},
},
},
});
Container Padding
unlayer.init({
tools: {
social: {
properties: {
containerPadding: {
value: '10px',
},
},
},
},
});
Custom Icons
Social media tool comes with a default set of social media networks. If you want to add a different social network, you can do that. Each custom icon must have an image url available for all icon types:
- circle
- circle-black
- circle-white
- rounded
- rounded-black
- squared
- squared-black