Skip to content

feat: add stacked layout to odyssey_toggle_button - #59

Merged
coladarci merged 1 commit into
mainfrom
feature/toggle-button-stacked-layout
Apr 29, 2026
Merged

feat: add stacked layout to odyssey_toggle_button#59
coladarci merged 1 commit into
mainfrom
feature/toggle-button-stacked-layout

Conversation

@coladarci

@coladarci coladarci commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator
image

Summary

  • Adds a layout attr to odyssey_toggle_button:inline (default, existing behavior unchanged) or :stacked
  • Stacked mode renders a vertical list of full-width options, each with a radio-style SVG indicator, option name, and optional description below the name
  • Active/inactive states use custom SVGs (filled blue circle vs outlined grey circle)
  • Options support a new description key for stacked mode; omitting it skips the description line
  • layout is forwarded correctly through ToggleButtonInputComponent for form-integrated usage
  • Demo showcase updated with a commission-type example showing all four variants (three with descriptions, one without)

Usage

<.odyssey_toggle_button
  layout={:stacked}
  options={[
    %{label: "Pre Tax Percentage Commission", value: :pre_tax, description: "Commission calculated before taxes are applied"},
    %{label: "After Tax Percentage Commission", value: :after_tax, description: "Commission calculated after taxes are applied"},
    %{label: "Flat Rate Commission", value: :flat_rate},
  ]}
  selected={@commission_type}
  on_change="change_commission_type"
/>

@coladarci
coladarci force-pushed the feature/toggle-button-stacked-layout branch 6 times, most recently from a307773 to 5a4ce1d Compare April 29, 2026 17:55
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coladarci
coladarci force-pushed the feature/toggle-button-stacked-layout branch from 5a4ce1d to 7ff33b9 Compare April 29, 2026 18:02
@coladarci
coladarci merged commit 731a43e into main Apr 29, 2026
7 checks passed
@martinatpeek
martinatpeek deleted the feature/toggle-button-stacked-layout branch April 29, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants