summaryrefslogtreecommitdiff
path: root/bs5/universal/native/shared/Row.re
blob: 451fa73d7c3f3b7705da4b498bc1fd29186278a1 (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
26
27
28
29
30
31
32
33
[@react.component]
let make =
    (
      ~gap=0,
      ~align: Theme.align=`start,
      ~justify: Theme.justify=`around,
      ~fullHeight=false,
      ~fullWidth=false,
      ~children,
    ) => {
  let className =
    Cx.make([
      "flex row",
      fullHeight ? "h-full" : "h-auto",
      fullWidth ? "w-full" : "w-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>;
};