kitchen-sink.gdc raw

; Exercises every declaration form and expression shape the compiler knows.
(component KitchenSink
  (prop title String)
  (prop step i32 :default 2)
  (prop scale f64 :default 1.5)
  (output changed i32)
  (state count i32 :init 0)
  (state active bool :init false)
  (handler bump)
  (handler toggle)

  (container :direction row :gap 8 :padding 4
             :width "50%" :height auto :grow 1 :shrink 0 :basis 100
             :align-items center :justify-content flex-end
             :background (if active "#ff0000aa" "#0f0")
             :on-click bump
    (text :text "{title}: {count} of {step}"
          :font-size 12.5
          :color "#333333"
          :on-pointer-enter toggle)
    (container :class "card padded" :corner-radius 4 :background "#abcdef"
               :enabled (not active)
      (text :text "static label"))
    (container :enabled false
      (text :text "always off"))
    (scroll-area :axis both :width 80 :height 40 :direction column
      (text :text "overflowing")
      (text :text "content"))))