Skip to Content
This is our docs site, visit our main website at strut.fit 
API ReferenceTry-on Button Options

Try-on Button Options

Try-on button options are configured by adding the try-on button script and passing attributes to the strutfit-tryon-button component.

<script src="https://store-assistant-tryonbutton.strut.fit" async></script>
<strutfit-tryon-button product-code="{{ProductIdentifier}}"></strutfit-tryon-button>

Required Parameters

  • product-code: Unique product identifier used for products in StrutFit.
    • Type: string

Optional Parameters

  • product-name: Overrides the product name used in the app.

    • Type: string
    • Default: Product name set on the StrutFit dashboard
  • product-image-url: Overrides the product image used in the app.

    • Type: string
    • Default: Product image set on the StrutFit dashboard
  • variant: Sets the button variant style.

    • Type: string
    • Allowed values: contained, outlined
    • Default value: contained
  • show-icon: Controls icon visibility.

    • Type: boolean
  • disabled: Disables button interaction when set to true.

    • Type: boolean
  • full-width: Makes the button fill the width of its container when set to true.

    • Type: boolean
  • border-radius: Sets button border radius.

    • Type: string
  • font-family: Sets button font family.

    • Type: string
    • Default behavior: Attempts to inherit your website’s primary font then falls back to -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif
  • font-size: Sets button font size.

    • Type: string
  • font-weight: Sets button font weight.

    • Type: string
  • background-color: Sets button background color.

    • Type: string
  • border: Sets the full CSS border value.

    • Type: string
  • border-color: Sets the border color.

    • Type: string
  • color: Sets text color.

    • Type: string
  • icon-color: Sets icon color.

    • Type: string
  • margin: Sets shorthand margin.

    • Type: string
  • margin-top: Sets top margin.

    • Type: string
  • margin-left: Sets left margin.

    • Type: string
  • margin-bottom: Sets bottom margin.

    • Type: string
  • margin-right: Sets right margin.

    • Type: string
  • text-transform: Sets text transform (e.g. uppercase, lowercase, capitalize).

    • Type: string
  • line-height: Sets the line height.

    • Type: string
    • Default value: 1

Example With All Options

<strutfit-tryon-button product-code="{{ProductIdentifier}}" product-name="{{ProductTitle}}" product-image-url="{{ProductImage}}" variant="contained" show-icon="true" disabled="false" full-width="true" border-radius="8px" font-family="arial" font-size="14px" font-weight="700" background-color="#3b82f6" border="1px solid #3b82f6" border-color="#3b82f6" color="#ffffff" icon-color="#ffffff" margin="8px 0" margin-top="8px" margin-left="0" margin-bottom="8px" margin-right="0" text-transform="uppercase" line-height="1" ></strutfit-tryon-button>
Last updated on