Collapsible
An interactive component which expands/collapses a panel.
Usage
Example
@joeldrapper starred 3 repositories
phlex-ruby/phlex
phlex-ruby/phlex-rails
PhlexUI/phlex_ui
Collapsible do div(class: "flex items-center justify-between space-x-4 px-4 py-2") do h4(class: "text-sm font-semibold") { " @joeldrapper starred 3 repositories" } CollapsibleTrigger do Button(variant: :ghost, icon: true) do chevron_icon span(class: "sr-only") { "Toggle" } end end end div(class: "rounded-md border px-4 py-2 font-mono text-sm shadow-sm") do "phlex-ruby/phlex" end CollapsibleContent do div(class: 'space-y-2 mt-2') do div(class: "rounded-md border px-4 py-2 font-mono text-sm shadow-sm") do "phlex-ruby/phlex-rails" end div(class: "rounded-md border px-4 py-2 font-mono text-sm shadow-sm") do "PhlexUI/phlex_ui" end end end end
Copied!
Copy failed!
Open
@joeldrapper starred 3 repositories
phlex-ruby/phlex
phlex-ruby/phlex-rails
PhlexUI/phlex_ui
Collapsible(open: true) do div(class: "flex items-center justify-between space-x-4 px-4 py-2") do h4(class: "text-sm font-semibold") { " @joeldrapper starred 3 repositories" } CollapsibleTrigger do Button(variant: :ghost, icon: true) do chevron_icon span(class: "sr-only") { "Toggle" } end end end div(class: "rounded-md border px-4 py-2 font-mono text-sm shadow-sm") do "phlex-ruby/phlex" end CollapsibleContent do div(class: 'space-y-2 mt-2') do div(class: "rounded-md border px-4 py-2 font-mono text-sm shadow-sm") do "phlex-ruby/phlex-rails" end div(class: "rounded-md border px-4 py-2 font-mono text-sm shadow-sm") do "PhlexUI/phlex_ui" end end end end
Copied!
Copy failed!
Components
Component | Built using | Source |
---|---|---|
Collapsible | Phlex | |
CollapsibleContent | Phlex | |
CollapsibleTrigger | Phlex | |
CollapsibleController | Stimulus JS |