Label
Form field label for inputs and controls.
Enter your email...
Enter your password...
import { Label } from "@/components/ui/label";
import { Input } from "@/components/ui/input";
export function MyScreen() {
return (
<View>
<Label>Email</Label>
<Input placeholder="Enter your email..." />
</View>
);
}Installation
npx @aniui/cli add labelUsage
app/index.tsx
import { Label } from "@/components/ui/label";
import { Input } from "@/components/ui/input";
export function MyScreen() {
return (
<View>
<Label>Email</Label>
<Input placeholder="Enter your email..." />
</View>
);
}Props
PropTypeDefault
classNamestring—Also accepts all Text props from React Native.
Source
components/ui/label.tsx
import React from "react";
import { Text } from "react-native";
import { cn } from "@/lib/utils";
export interface LabelProps extends React.ComponentPropsWithoutRef<typeof Text> {
className?: string;
}
export function Label({ className, ...props }: LabelProps) {
return (
<Text
className={cn("text-sm font-medium text-foreground leading-none", className)}
{...props}
/>
);
}