diff --git a/packages/react/components/Label.tsx b/packages/react/components/Label.tsx new file mode 100644 index 0000000..b88355f --- /dev/null +++ b/packages/react/components/Label.tsx @@ -0,0 +1,38 @@ +import React from "react"; +import { VariantProps, vcn } from "../shared"; + +const [labelVariant, resolveLabelVariantProps] = vcn({ + base: "", + variants: { + vertical: { + true: "flex flex-col gap-2 justify-center items-start", + false: "", + }, + horizontal: { + true: "flex flex-row gap-2 justify-start items-center", + false: "", + }, + }, + defaults: { + vertical: false, + horizontal: false, + }, +}); + +interface LabelProps + extends VariantProps, + React.ComponentPropsWithoutRef<"label"> {} + +const Label = React.forwardRef((props, ref) => { + const [variantProps, otherPropsCompressed] = resolveLabelVariantProps(props); + + return ( +