Renders an accessible label associated with controls.
export * from "./label"; export * from "./styles";
"use client"; import { Label as LabelPrimitive } from "react-aria-components"; import { LabelStyles } from "./styles"; export interface LabelProps extends React.ComponentProps<typeof LabelPrimitive> {} export function Label({ className, ...props }: LabelProps) { return <LabelPrimitive {...props} className={LabelStyles({ className })} />; }
import { cva } from "~/lib/cva"; export const LabelStyles = cva({ base: [ "w-fit cursor-default font-medium text-secondary-fg text-sm", "group-required:after:ml-0.5 group-required:after:text-danger group-required:after:content-['*']", ], });
import { Label } from "~/components/ui/label";
<Label>Label</Label>
On This Page
Contribute