You can use this to progressively enhance any HTML element to become a follow button.
When clicked, the component will open the instancepicker component and then selected instance with the given account loaded for easy following.
<mastodon-follow account="splitbrain@octodon.social">
<a href="https://octodon.social/@splitbrain">Follow me</a>
</mastodon-follow>
Note: the component will apply pointer-events: none
to all top-level a
elements to prevent the default click action. If you have a better idea on how to achieve this, please let me know.
A wrapper around any HTML which will capture clicks and execute a follow action instead.
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
account |
account |
The account to follow in the form user@example.com |
string |
undefined |
graph TD;
mastodon-follow --> mastodon-instancepicker
mastodon-widget --> mastodon-follow
style mastodon-follow fill:#f9f,stroke:#333,stroke-width:4px
Built with StencilJS