Customize
Customize share buttons: every setting, with a demo you can press.
Each one is a class on the kit or a key in ats_config. Open any of them for the code, what to watch for, and working buttons.
54settings
54 customization guides
No matching guides. Try “menu”, “image” or “color”.
Popular
5 settingsOne service at a time
5 settingsOne kit or many
3 settingsBehind the scenes
6 settingsEvery option
Set window.ats_config before the widget script runs. Every key is optional.
| Key | Type | What it does |
|---|---|---|
url | string | Default link to share. A kit’s data-url takes priority. Default: Page canonical URL, then location.href. |
title | string | Default message/title. A kit’s data-title takes priority. Default: og:title, then document.title. |
image | string | Image URL for endpoints such as Pinterest. A kit’s data-image takes priority. Default: og:image, then empty. |
num_services | number | Maximum inline service buttons. An empty kit uses the default catalog set; More offers the remaining allowed services. Default: No limit. |
native | boolean | Use the device share sheet when available. true also enables it on desktop; false always uses the widget menu. Default: Automatic on mobile/touch. |
lang | string | Explicit locale wins. Supported base codes: en, vi, de, fr, es, pt, ja, zh. Regional codes use their base language; unsupported explicit/page languages fall back to English. Default: Page language, then browser language. |
strings | object | Override individual labels: share, more, search, close, copied, shareTo, noResults, followOn, shareCount, shareFailed. Empty or invalid values fall back to the selected language. Default: {}. |
theme | string | light or dark pins widget surfaces to your site theme. Call addtosite.theme() to update surfaces already rendered. Default: Operating-system preference. |
services | string[] or string | Allowlist of service keys, also accepted as comma-separated text. An empty list leaves all services available. Default: All available services. |
exclude_services | string[] or string | Exclude these services when no nonempty allowlist is set. A nonempty services list takes priority. Default: []. |
priority | string[] or string | Order these services first, followed by saved preferences and then catalog order. Filtering and platform restrictions still apply. Default: []. |
custom_services | object[] | Register services before loading: key, name, color, and url and/or follow. Optional fg and HTTP(S) icon URL. URL templates use {url}, {title}, {image}; follow uses {handle}. Default: []. |
share_url | object | Replace service endpoint templates by key. Supports {url}, {title}, {image}; accepted schemes are HTTP(S), mailto and sms. Default: {}. |
mastodon_instance | string | Mastodon server used for share and follow URLs. Default: mastodon.social. |
menu_type | string | mail restricts universal and quick menus to supported email providers; it also bypasses automatic native sharing. Default: All share services. |
menu_search | boolean | Show the search field in the full menu. Default: true. |
menu_trigger | string | hover opens the full menu after hover_delay. Click and keyboard activation remain available; touch uses click. Default: click. |
hover_delay | number | Hover delay in milliseconds, bounded to 0–2000. Leaving the trigger cancels the pending open. Default: 200. |
quick_menu | boolean or string | true or click opens a compact menu on click; hover opens on hover; static keeps it visible. quick_count, quick_orientation or quick_position also enable it. Default: Off. |
quick_count | number | Compact-menu service count, from 1 to 24. More remains available. Default: 6. |
quick_orientation | string | horizontal or vertical button arrangement in the compact menu. Default: horizontal. |
quick_position | string | auto opens below and flips upward when needed; up or down forces the opening direction. This does not change the row/column arrangement or a static menu. Default: auto. |
track | boolean | Send anonymous widget-action pings. false stops these pings; it does not disable count reads or your page’s analytics integration. Default: true. |
analytics | boolean | Report share events to an existing gtag or dataLayer. No analytics library is loaded. false disables this independently of track. Default: true. |
counters | boolean | Fetch and show this widget’s recorded action counts on service buttons. These are not network-wide popularity or confirmed published posts. Default: false. |
api | string | Counting API base URL for a self-hosted backend. Sharing never waits for this service. Default: //data.addtosite.com/v1. |
link_campaign | string | Add utm_source=<service>, utm_medium=social and utm_campaign=<value> to shared URLs. Existing values for these parameters are replaced. Default: Unset. |
shorten | function | Receives the campaign URL and returns an HTTP(S) URL or Promise. Popup shares fall back after an error or 3-second timeout. Native sharing and local actions do not wait for this hook. Default: Unset. |
ready | function or function[] | Receives the API once after the initial document scan. Use it for code that requires the asynchronously loaded widget. Default: Unset. |
onBeforeShare | function or function[] | Receives {service, url, title, image}. Modify the payload, or return false to cancel. Default: Unset. |
onShare | function or function[] | Runs after a popup opens, a local action succeeds or the native share Promise resolves. It does not confirm publication on a network. Default: Unset. |
dock_after | number | For floating bars, scroll distance in pixels before showing the bar. Zero disables scroll-based hiding. Default: 0. |
dock_until_foot | number | With dock_after enabled, hide the floating bar this many pixels before the document bottom. Default: 0. |
overlays | boolean | Enable image share overlays; loads overlays.js beside widget.js. Default: false. |
overlay_min_size | number | Both rendered image dimensions must meet this size in pixels. Default: 200. |
overlay_target | string | CSS selector restricting images. Header/footer/widget images, hidden images and data-ats-no-overlay ancestors are excluded. Default: All eligible images. |
overlay_show | string | visible keeps buttons displayed, including on touch screens. hover reveals them on hover or tap. Default: hover. |
overlay_services | string[] | Service keys in overlay order; dd means More. The basic uncustomized overlay uses one universal button. Default: ["pinterest", "dd"] when customized. |
overlay_size | number | Image button size, bounded to 16–64 pixels. Default: 32. |
overlay_orientation | string | horizontal or vertical layout for customized image buttons. Default: vertical. |
overlay_position | string | Vertical position top/center/bottom plus horizontal left/center/right, for example bottom-center. Default: top-left. |
overlay_use_image | boolean | Share the image file URL. Otherwise share longdesc, the canonical page URL or location.href; the image itself still fills {image}. Default: false. |
overlay_html | string | Trusted HTML containing one ats_kit root. Replaces overlay services/size/orientation markup while keeping position and image context. Default: Unset. |
Class names you can style
| Class | Applies to |
|---|---|
.ats_kit | The container holding a row of buttons |
.ats_btn | Every button, whichever service |
.ats_btn_<service> | One specific service |
.ats_dd | The More button |
.ats_label | The text beside an icon |
.ats_menu | The share sheet panel |
.ats_overlay | The scrim behind the sheet, and where its colour variables live |
data-ats-keep | On a button: leave what is inside it alone, and style it yourself |