Auth0 Universal Components
    Preparing search index...

    Type Alias EnhancedTranslationFunction

    EnhancedTranslationFunction: TranslationFunction & {
        trans: (
            key: string,
            options?: {
                components?: TranslationElements;
                fallback?: string;
                vars?: Record<string, unknown>;
            },
        ) => (string | TransComponent)[];
    }

    Enhanced translation function with Trans component support. Extends the basic translation function with a trans method for safe component rendering. Framework-agnostic - works with any UI framework.

    Type Declaration

    • trans: (
          key: string,
          options?: {
              components?: TranslationElements;
              fallback?: string;
              vars?: Record<string, unknown>;
          },
      ) => (string | TransComponent)[]

      Renders a translation with framework components for safe HTML-like content. Returns an array of strings and framework-specific components.

      // Framework-agnostic usage
      const elements = t.trans('help.message', {
      components: {
      link: (children) => createLinkComponent(children)
      },
      vars: { name: 'John' }
      });

      // Result: ['Hello ', LinkComponent, ', click here for help.']