Label
An accessible label associated with a form control.
npx shadcn@latest add @velaui/labelpnpm dlx velaui add @velaui/labelyarn dlx shadcn@latest add @velaui/labelbunx --bun shadcn@latest add @velaui/labelveni add labelInstalls the copy of vela-ui that veni-builder serves to Venizia apps; veni-builder serves the Radix UI copy only, so this tab exists for that base alone.
npx shadcn@latest add @velaui/labelpnpm dlx velaui add @velaui/labelyarn dlx shadcn@latest add @velaui/labelbunx --bun shadcn@latest add @velaui/labelExamples
- Default
- With input
Usage
Props
Takes every prop of LabelProps.
Dependencies
- npm
radix-ui@1.6.0- Installs with it
- nothing else
- npm
- none besides React
- Installs with it
- nothing else
Source
components/ui/label.tsx
import * as React from "react"
import { Label as LabelPrimitive } from "radix-ui"
import { cn } from "@/lib/utils"
export type LabelProps = React.ComponentProps<typeof LabelPrimitive.Root>;
function Label({
className,
...props
}: LabelProps) {
return (
<LabelPrimitive.Root
data-slot="label"
className={cn(
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
className
)}
{...props}
/>
)
}
export { Label }components/ui/label.tsx
import * as React from "react"
import { cn } from "@/lib/utils"
export type LabelProps = React.ComponentProps<"label">;
function Label({
className,
...props
}: LabelProps) {
return (
<label
data-slot="label"
className={cn(
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-data-disabled:cursor-not-allowed peer-data-disabled:opacity-50",
className
)}
{...props}
/>
)
}
export { Label }