Skip to main content

Custom Button Styling

Create a fully custom button

Faslet provides a special mode, called buttonless, which allows you to build your own button, and invoke the widget flow programatically. You also recieved callbacks for when sizes are recommended (including the automatic recommendation system) that allows for showing a recommendation in place of the usual button.


This feature is currently only for higher tier customers and not available on our S or M plans. If you are in doubt, or would like to find activate this for your store, please contact us at

Once buttonless is enabled, simply add the following method to the window._faslet object.

onResult?: ({ label: string }, resultType: 'auto' | 'result-screen') => unknown;
labelThis matches the size labels on the store. For example; S,M,Lthe recommended size
resultType'auto' or 'result-screen'Where the recommendation was triggered from. auto is the automatic size recommendation for users that have already filled in the widget, and are automatically given a size recommendation without opening the widget. result-screen is the last screen of the widget flow.

To programatically open the widget from your new custom button, simply invoke the method:


This method is added after the widget code loads successfully.


Please do not try to override the CSS styling of the widget and/or button. While it may work today, future widget updates may change class names, and overrides may stop working. Except for the buttonless mode, we do not provide guarantees on our CSS class names, IDs or HTML structure.


A very simplistic example of this working might look like this:

<!DOCTYPE html>
<html lang='en'>
<meta charset='UTF-8'>
<script src=""></script>
<div id="faslet-button">
<p id="faslet-button-text">What's my size?</p>
var fasletButton = document.querySelector('#faslet-button');
var fasletButtonText = document.querySelector('#faslet-button-text');

window._faslet = {
shopUrl: 'SHOP_URL',
addToCart: function(id) {
variants: [
colors: [
onButtonShow: () => { = 'block';
fasletButton.onclick = () =>
window._faslet && window._faslet.openWidget ? window._faslet.openWidget() : undefined;
console.log('button loaded');
onButtonHidden: () => { = 'none';
console.error('button hidden');
onResult: (result, resultType) => {
fasletButtonText.innerText = `We recommend ${result.label}`;


In case of any questions, please don’t hesitate to contact us on