diff options
Diffstat (limited to 'bs5/universal/native/shared/Stack.re')
-rw-r--r-- | bs5/universal/native/shared/Stack.re | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bs5/universal/native/shared/Stack.re b/bs5/universal/native/shared/Stack.re new file mode 100644 index 0000000..afb8e98 --- /dev/null +++ b/bs5/universal/native/shared/Stack.re @@ -0,0 +1,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>; +}; |