You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Goal
Add a collapsible() component to Preswald to support collapsible sections in the layout, enabling users to group related UI components inside expandable/collapsible containers.
📌 Motivation
Many data apps and dashboards built with Preswald involve long sequences of components—sliders, charts, tables, etc. Without layout control, the UI can become overwhelming. Grouping components within collapsible panels will:
Improve readability by reducing visible clutter
Allow logical grouping of related inputs and outputs
Enhance UX for interactive filtering and step-by-step exploration
This aligns with Preswald’s goal of creating structured, clean, and responsive data apps from simple Python scripts.
✅ Acceptance Criteria
Introduce collapsible() in preswald/preswald/interfaces/components.py
Render collapsible UI using ShadCN’s <Collapsible /> component from frontend/src/components/ui/collapsible.tsx
✨ Optional: Nest children by pushing future components into a sublist within this container, depending on how Preswald manages layout/component trees internally.
🧪 Testing Plan
Add collapsible(label="Advanced Filters") above a group of sliders in examples/iris/hello.py
Confirm collapsible behavior toggles content visibility in browser
@amrutha97 I wanted to try working on this, but had a doubt - Are all components after the collapsible() considered to be its children? Or are the components supposed to be explicitly passed as children to collapsible()?
Goal
Add a
collapsible()
component to Preswald to support collapsible sections in the layout, enabling users to group related UI components inside expandable/collapsible containers.📌 Motivation
Many data apps and dashboards built with Preswald involve long sequences of components—sliders, charts, tables, etc. Without layout control, the UI can become overwhelming. Grouping components within collapsible panels will:
This aligns with Preswald’s goal of creating structured, clean, and responsive data apps from simple Python scripts.
✅ Acceptance Criteria
collapsible()
inpreswald/preswald/interfaces/components.py
<Collapsible />
component fromfrontend/src/components/ui/collapsible.tsx
/frontend/src/components/widgets/CollapsibleWidget.jsx
DynamicComponents.jsx
label: str
(title/header of the collapsible section)open: bool
(default open/closed)size: float
(for layout control)🛠️ Implementation Plan
1. Backend – Add Component
preswald/interfaces/components.py
Register it in
interfaces/__init__.py
:2. Frontend – Add Widget
Create:
frontend/src/components/widgets/CollapsibleWidget.jsx
3. DynamicComponents.jsx – Register
🧪 Testing Plan
collapsible(label="Advanced Filters")
above a group of sliders inexamples/iris/hello.py
preswald run
and validate via localhost:8501🧾 Example Usage
📚 Docs To Update
/docs/sdk/collapsible.mdx
– with parameters, return type, image/docs/layout/guide.mdx
– mention collapsible as layout tool📂 Related Files
frontend/src/components/ui/collapsible.tsx
frontend/src/components/widgets
preswald/interfaces/components.py
DynamicComponents.jsx
🧩 Additional Notes
collapsible()
should not return a value — it's purely structuralThe text was updated successfully, but these errors were encountered: