Page Favouriting

Page Favouriting

About Page Favouriting

About

A customizable favorite/like button that shows total favorites and remembers if the current user has favorited the page. When clicked, it updates both the visual state and total count, saves the user's preference in their browser. No need for additional APIs/subscriptions/set up. Just drag and drop and see it in effect.

This component a part of the 400+ components, layouts, templates, UI Kits and code overrides from SegmentUI PRO. Click here to see the full library

Instructions

  1. Copy and paste the FavoriteButton component into your project file

  2. Customize the appearance through the properties panel

  3. Publish and preview URL

  4. The button will automatically:

    • Show total favorites from all users

    • Remember if the current user has favorited (using local storage)

    • Update counts instantly when clicked

  5. To test it out, open the URL in a different device or in incognito.

How It Works

The component is pre-connected to a public Supabase database that stores total favorites per page. It uses local storage to remember each user's favorites across sessions. You can customize:

  1. Icon Type: Choose between heart, star, or bookmark

  2. Icon Size

  3. Spacing

  4. Active/Inactive Colors

  5. Font: Complete typography control

Note: The component uses a shared public Supabase instance with rate limiting and row-level security in place. While this isn't the most secure approach, it enables drag-and-drop functionality since we're only tracking basic interactions.

Support

For any queries and help setting up the component, contact hello@segmentui.com