Componentdata0.44 KB gzipZero dependencies
Centered Card
Centered single card layout for login/register pages.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add centered-cardOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { CenteredCard } from "@/components/ui/centered-card"; <CenteredCard />Source code
centered-card.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxcentered-card.tsx29 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface CenteredCardProps extends React.HTMLAttributes<HTMLDivElement> { children: React.ReactNode; /** Top logo/header slot */ header?: React.ReactNode; /** Bottom helper text slot */ footer?: React.ReactNode; maxWidth?: "sm" | "md";} /** Centered single card container for login / registration screens. */export function CenteredCard({ children, header, footer, maxWidth = "sm", className, ...props }: CenteredCardProps) { return ( <div className={cn("flex min-h-[420px] w-full items-center justify-center bg-secondary/30 p-6", className)} {...props}>Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { CenteredCard } from "@/components/ui/centered-card"; <CenteredCard />| Prop | Type | Description |
|---|---|---|
| children | React.ReactNode | Child elements rendered inside the component. |
| header | React.ReactNode | Top logo/header slot |
| footer | React.ReactNode | Bottom helper text slot |
| maxWidth | "sm" | "md" | Configures max width. (Default: "sm") |