summaryrefslogtreecommitdiff
path: root/bs5/universal/native/shared/Stack.re
blob: afb8e98f2e981b5615eadef14e599f6bf3d868ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[@react.component]
let make =
    (~gap=0, ~align=`start, ~justify=`around, ~fullHeight=false, ~children) => {
  let className =
    Cx.make([
      "flex flex-col",
      fullHeight ? "h-full" : "h-auto",
      "gap-" ++ Int.to_string(gap),
      switch (align) {
      | `start => "items-start"
      | `center => "items-center"
      | `end_ => "items-end"
      },
      switch (justify) {
      | `around => "justify-around"
      | `between => "justify-between"
      | `evenly => "justify-evenly"
      | `start => "justify-start"
      | `center => "justify-center"
      | `end_ => "justify-end"
      },
    ]);

  <div className> children </div>;
};