Heading
tetra-ui/headingFreeComponent
A component to display headings.
Live preview
live · rendered by the registry
Rendered by tetra-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://tetra-ui.com/r/heading.jsonSource
1import { cva, type VariantProps } from "class-variance-authority";2import { Text } from "react-native";3import { cn } from "../lib/utils";45// Types6export type HeadingProps = React.ComponentProps<typeof Text> &7 VariantProps<typeof headingVariants>;89// Components10export const Heading = ({11 children,12 className,13 level,14 ...props15}: HeadingProps) => {16 return (17 <Text className={cn(headingVariants({ className, level }))} {...props}>18 {children}19 </Text>20 );21};2223// Styles24const headingVariants = cva("font-bold text-foreground tracking-tight", {25 defaultVariants: {26 level: "1",27 },28 variants: {29 level: {30 "1": "text-4xl",31 "2": "text-3xl",32 "3": "text-2xl",33 "4": "text-xl",34 "5": "text-lg",35 "6": "text-base",36 },37 },38});
Files it writes
More from tetra-ui
All 41 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | tetra-ui | Components | Free | 1 dep | |
| Action Inputaction-input | tetra-ui | Components | Free | no deps | |
| Alertalert | tetra-ui | Components | Free | no deps | |
| Avataravatar | tetra-ui | Components | Free | no deps | |
| Badgebadge | tetra-ui | Components | Free | no deps | |
| Bottom Sheetbottom-sheet | tetra-ui | Components | Free | 4 deps · 7 files | |
| Buttonbutton | tetra-ui | Components | Free | no deps | |
| Cardcard | tetra-ui | Components | Free | no deps |
