Nov 6, 2019
White Arrow icon
Back to all Elements

"Highlight & Share" with Sharect.js (like in Medium)

A lightweight 'Select text and share / tweet'

This is really lightweight and easy!

First we add the script source to our project, before the</body> tag.

* if we want the plugin to work on the entire website we add it in the project's settings under custom code. otherwise we can add it on the page's custom code section.

<script src=""></script>


2nd step is to add the code that triggers the plugin. We should add this right after the previous code.

Some options are available, like icon color, background color, which elements can be selected and Facebook share (needs additional code).


 var sharect = new Sharect();




That is about it!

Depending on your page structure, the plugin might be hidden under a higher z-indexed layer, so add this to your <head> tag:


.sharect {

z-index: 9999;






The videos Kurzgesagt channel creates are so beautifully animated, that I almost forget that I learn so much while watching them!

Might also interest you:

Webflow Dashboard Workspaces Hack

Webflow UI Hack

Convert the Workspaces dropdown to an open sidebar with custom order.

Read more
White Arrow icon

Dynamic Height


A (custom code) solution that combines CSS variables and Vanilla JavaScript for the shrinking / growing of browser top & bottom bars.

Read more
White Arrow icon

Maintain Form Height on Success


Using a little bit of jQuery to adjust the success message height

Read more
White Arrow icon