Want to try fastn for your company's website?
Book a Demo

Device component best practices

dont-use-device-condition: Don't use device condition to show or hide the component

It is strongly advised to utilize the ftd.desktop and ftd.mobile components in order to display components on desktop and mobile devices, respectively. This is because fastn performs optimization techniques, including decreasing the size of the created component tree, generating optimized code that renders quickly, and reducing the component's dependencies.

Additionally, it handles the variant of properties, such as ftd.responsive-type and ftd.length.responsive, that are specified for the corresponding devices.
Not recommended
-- desktop-page:
if: { ftd.device == "desktop" }
Lang:
ftd
Recommended
-- ftd.desktop:

-- desktop-page:

-- end: ftd.desktop
Lang:
ftd