Componentdata0.44 KB gzipZero dependencies

Centered Card

Centered single card layout for login/register pages.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add centered-card

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { CenteredCard } from "@/components/ui/centered-card"; <CenteredCard />

Source code

centered-card.tsx + 1 helper

Zero 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 />
PropTypeDescription
childrenReact.ReactNodeChild elements rendered inside the component.
headerReact.ReactNodeTop logo/header slot
footerReact.ReactNodeBottom helper text slot
maxWidth"sm" | "md"Configures max width. (Default: "sm")