From d02f1d1fedf9bd48b6b5728b9711f907bd02512b Mon Sep 17 00:00:00 2001 From: Ellyse Date: Mon, 22 Sep 2025 15:51:17 +0000 Subject: [PATCH] example using ct-autolayout and aside --- packages/patterns/aside.tsx | 74 +++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 packages/patterns/aside.tsx diff --git a/packages/patterns/aside.tsx b/packages/patterns/aside.tsx new file mode 100644 index 000000000..c34c55c23 --- /dev/null +++ b/packages/patterns/aside.tsx @@ -0,0 +1,74 @@ +/// +import { + Cell, + cell, + Default, + derive, + h, + handler, + ifElse, + lift, + NAME, + navigateTo, + recipe, + toSchema, + UI, +} from "commontools"; + +// note: you may need to zoom in our out in the browser to see the +// content and/or tabs +export default recipe( + "Aside", + () => { + return { + [NAME]: "Aside", + [UI]: ( + // ct-screen provides a full-height layout with header/main/footer areas + + {/* Header slot - fixed at top */} +
+

Header Section

+
+ + {/* ct-autolayout creates responsive multi-panel layout with optional sidebars */} + {/* tabNames: Labels for main content panels (shown as tabs on mobile) */} + {/* Shows all panels side-by-side in a grid */} + + {/* Left sidebar - use slot="left" */} + + + {/* Main content panels - no slot attribute needed */} + {/* Number of divs should match number of tabNames */} +
+

Main Content Area

+

This is the main content with sidebars

+ Main Button +
+ +
+

Second Content Area

+

This is the second content with sidebars

+ Second Button +
+ + {/* Right sidebar - use slot="right" */} + +
+ + {/* Footer slot - fixed at bottom */} +
+

Footer Section

+
+
+ ), + }; + }, +);