PhoenixKitWeb.Live.Components.UserSettings (phoenix_kit v1.7.102)

Copy Markdown View Source

Reusable LiveComponent for user settings management.

Provides profile, email, password, and OAuth settings in a self-contained component that can be embedded in any LiveView.

Usage

<.live_component
  module={PhoenixKitWeb.Live.Components.UserSettings}
  id="user-settings"
  user={@current_user}
/>

Required assigns

  • user — the current user struct
  • id — unique component ID

Optional assigns

  • sections — list of sections to display: :identity, :custom_fields, :email, :password, :oauth, :notifications (default: all six). :profile is accepted as a legacy alias that expands to [:identity, :custom_fields]
  • email_confirm_url_fn(token -> url) for email confirmation links (default: &Routes.url("/dashboard/settings/confirm-email/#{&1}"))
  • return_to — where OAuth redirect returns to (default: "/dashboard/settings")

Parent notifications

Sends {:phoenix_kit_user_updated, updated_user} to the parent LiveView when user data changes (profile, avatar, email, password).