PhoenixKit.Modules.Publishing.Web.Components.VersionSwitcher (phoenix_kit v1.7.71)
Copy Markdown View SourceVersion switcher component for publishing posts.
Displays available versions as a compact inline list with status indicators. Used in the publishing editor to navigate between different versions of a post.
Display Format
Admin mode: v1 (●) | v2 (●) | v3 (○)
- Green dot (●): Published (this IS the live version)
- Yellow dot (●): Draft
- Gray dot (●): Archived
- Current version is highlighted
Examples
# Editor: switch between versions
<.publishing_version_switcher
versions={@available_versions}
version_statuses={@version_statuses}
current_version={@current_version}
on_click="switch_version"
/>
Summary
Functions
Renders a compact inline version switcher.
Functions
Renders a compact inline version switcher.
Attributes
versions- List of version numbers (integers)version_statuses- Map of version number => status string ("published", "draft", "archived")version_dates- Map of version number => ISO 8601 date string (shown in tooltip)current_version- Currently active version numberon_click- Event name for click handlerphx_target- Target for the eventclass- Additional CSS classessize- Size variant: :xs, :sm, :md (default: :sm)
Note: Only ONE version can have status "published" at a time. This is the live version.
Attributes
versions(:list) (required)version_statuses(:map) - Defaults to%{}.version_dates(:map) - Defaults to%{}.current_version(:integer) - Defaults tonil.on_click(:string) - Defaults tonil.phx_target(:any) - Defaults tonil.class(:string) - Defaults to"".size(:atom) - Defaults to:sm. Must be one of:xs,:sm, or:md.