new-personal-site/components/lib/layout/Stack.tsx
Benjamin Toby 8762e2da8d Updates
2025-03-27 07:37:16 +01:00

32 lines
724 B
TypeScript

import _ from "lodash";
import { DetailedHTMLProps, HTMLAttributes } from "react";
import { twMerge } from "tailwind-merge";
type Props = DetailedHTMLProps<
HTMLAttributes<HTMLDivElement>,
HTMLDivElement
> & {
center?: boolean;
};
/**
* # Flexbox Column
* @className twui-stack
*/
export default function Stack({ ...props }: Props) {
const finalProps = _.omit(props, "center");
return (
<div
{...finalProps}
className={twMerge(
"flex flex-col items-start gap-4",
props.center && "items-center",
"twui-stack",
props.className
)}
>
{props.children}
</div>
);
}