Websites v4 docs v5.2.5
    Preparing search index...

    Function usePropertyBrandColor

    • React hook to determine property band color based on branding rules, tags, channel, and optionally the current pathname.

      This hook searches for a matching branding rule using the following priority:

      1. If usePath is true, it checks if the current pathname contains any keywords from the branding rules (using tags or channel keywords).
      2. If no match is found and tags are provided, it checks if any tag matches a branding rule keyword.
      3. If still no match and channel is provided, it checks if the channel matches a branding rule keyword.

      If a matching branding rule is found, its background color is returned. If no match is found, an empty string is returned.

      Parameters

      • params: UseBrandColor

        Parameters for the hook.

        • brandingRules

          Array of branding rules to match against.

        • tags

          Property tags to match against branding rule keywords.

        • channel

          Channel name to match against branding rule keywords.

        • usePath

          Whether to use the current pathname for matching.

      Returns string

      The matching brand color as a CSS color string, or an empty string if no match is found.