{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "blog-typography-shadcnui", "type": "registry:component", "title": "Blog Typography", "description": "Beautiful blog post typography with text, links, images, blockquotes, and code examples", "registryDependencies": [ "button" ], "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/components/blog/blog-typography.tsx", "content": "\"use client\";\n\nimport { motion, type Variants } from \"framer-motion\";\nimport { Code, ExternalLink, Quote } from \"lucide-react\";\nimport Image from \"next/image\";\nimport type React from \"react\";\n\n// ============================================================================\n// TYPES & INTERFACES\n// ============================================================================\n\ninterface LinkProps {\n href: string;\n children: React.ReactNode;\n external?: boolean;\n}\n\ninterface ImageCardProps {\n src: string;\n alt: string;\n caption?: string;\n}\n\ninterface CalloutProps {\n children: React.ReactNode;\n type?: \"info\" | \"warning\" | \"success\";\n}\n\n// ============================================================================\n// ANIMATION VARIANTS\n// ============================================================================\n\nconst containerVariants: Variants = {\n hidden: { opacity: 0 },\n visible: {\n opacity: 1,\n transition: {\n staggerChildren: 0.1,\n delayChildren: 0.1,\n },\n },\n};\n\nconst itemVariants: Variants = {\n hidden: { opacity: 0, y: 20 },\n visible: {\n opacity: 1,\n y: 0,\n transition: { duration: 0.5 },\n },\n};\n\n// ============================================================================\n// SUB-COMPONENTS\n// ============================================================================\n\n// Animated Link Component\nfunction AnimatedLink({ href, children, external = false }: LinkProps) {\n return (\n \n \n {children}\n \n \n {external && (\n \n )}\n \n );\n}\n\n// Image Card Component\nfunction ImageCard({ src, alt, caption }: ImageCardProps) {\n return (\n \n
\n\n
\n {alt}\n
\n\n {caption && (\n
\n {caption}\n
\n )}\n \n );\n}\n\n// Callout Box Component\nfunction Callout({ children, type = \"info\" }: CalloutProps) {\n const colors = {\n info: \"bg-primary/10 border-primary/30 text-foreground\",\n warning: \"bg-amber-500/10 border-amber-500/30 text-foreground\",\n success: \"bg-emerald-500/10 border-emerald-500/30 text-foreground\",\n };\n\n return (\n \n
{children}
\n \n );\n}\n\n// ============================================================================\n// MAIN COMPONENT\n// ============================================================================\n\nexport function BlogTypography() {\n return (\n
\n {/* Glassmorphism background blobs */}\n
\n
\n
\n
\n
\n\n {/* Main Content */}\n
\n \n {/* Article Header */}\n \n
\n \n Design System\n
\n\n

\n \n The Art of Beautiful Typography\n \n

\n\n

\n Exploring the nuances of type design, hierarchy, and readability\n in modern web interfaces\n

\n\n
\n \n \n 8 min read\n
\n
\n\n {/* Introduction */}\n \n

\n Typography is the foundation of good design. It's not just\n about choosing beautiful fonts-it's about creating hierarchy,\n establishing rhythm, and guiding the reader through your content\n with intention and care.\n

\n\n

\n In this article, we'll explore the fundamental principles\n that make typography work, from the basics of font pairing to the\n subtle art of whitespace. Whether you're designing a website,\n an app, or a printed publication, these principles will help you\n create more readable, accessible, and beautiful designs.\n

\n
\n\n {/* Image Example */}\n \n\n {/* Section 1 */}\n \n

\n The Fundamentals of Type Hierarchy\n

\n\n

\n Type hierarchy is about creating visual distinction between\n different levels of information. Your readers should be able to\n scan your content and instantly understand what's important.\n This is achieved through careful manipulation of:\n

\n\n
    \n
  • \n Size{\" \"}\n - Larger text naturally draws more attention\n
  • \n
  • \n \n Weight\n {\" \"}\n - Bold text stands out from regular weight\n
  • \n
  • \n \n Spacing\n {\" \"}\n - Generous whitespace creates breathing room\n
  • \n
  • \n Color{\" \"}\n - Contrast and opacity guide attention\n
  • \n
\n
\n\n {/* Callout Example */}\n \n Pro Tip: Maintain a\n consistent scale for your typography. A modular scale (like 1.25 or\n 1.333) helps create harmonious relationships between different text\n sizes.\n \n\n {/* Section 2 with Blockquote */}\n \n

\n Choosing the Right Typeface\n

\n\n

\n The typeface you choose sets the tone for your entire design.\n Serif fonts like Georgia and Times convey tradition and authority,\n while sans-serif fonts like{\" \"}\n \n Geist\n {\" \"}\n and Inter feel modern and clean.\n

\n\n \n
\n\n \n\n

\n \"Typography is what language looks like. It's the visual\n form of the spoken word, and it has the power to enhance or\n diminish the message.\"\n

\n\n
\n - Ellen Lupton, Thinking with Type\n
\n \n \n\n {/* Section 3 with Code */}\n \n

\n Implementing Typography in Code\n

\n\n

\n When implementing typography in your design system, consistency is\n key. Here's an example of how you might define your type\n scale using CSS custom properties:\n

\n\n \n
\n\n
\n \n CSS\n
\n\n \n :root {\"{\"}\n
\n {\" \"}--font-size-xs: 0.75rem;\n
\n {\" \"}--font-size-sm: 0.875rem;\n
\n {\" \"}--font-size-base: 1rem;\n
\n {\" \"}--font-size-lg: 1.125rem;\n
\n {\" \"}--font-size-xl: 1.25rem;\n
\n {\" \"}--font-size-2xl: 1.5rem;\n
\n {\"}\"}\n
\n \n \n\n {/* Ordered List Example */}\n \n

\n Best Practices for Web Typography\n

\n\n \n
  • \n \n Limit line length\n {\" \"}\n - Keep your text between 50-75 characters per line for optimal\n readability\n
  • \n
  • \n \n Use adequate line height\n {\" \"}\n - A line height of 1.5-1.8 prevents text from feeling cramped\n
  • \n
  • \n \n Consider contrast\n {\" \"}\n - Ensure sufficient color contrast (minimum 4.5:1 for body text)\n
  • \n
  • \n \n Test at different sizes\n {\" \"}\n - Your typography should work on both mobile and desktop screens\n
  • \n \n
    \n\n {/* Another Image */}\n \n\n {/* Warning Callout */}\n \n Accessibility Note:{\" \"}\n Always test your typography with actual users, including those using\n screen readers or other assistive technologies. What looks beautiful\n isn't always what works best.\n \n\n {/* Conclusion */}\n \n

    \n Conclusion\n

    \n\n

    \n Great typography is invisible-it doesn't call attention to\n itself, but rather creates a seamless reading experience. By\n understanding the fundamentals of hierarchy, choosing appropriate\n typefaces, and following best practices, you can create designs\n that are both beautiful and functional.\n

    \n\n

    \n Remember, typography is an art that takes time to master.\n Experiment, iterate, and always prioritize readability and\n accessibility over purely aesthetic concerns. Your readers will\n thank you.\n

    \n
    \n\n {/* Footer with Links */}\n \n

    \n Further Reading\n

    \n\n \n \n \n
    \n
    \n );\n}\n", "type": "registry:component", "target": "components/uitripled/blog-typography-shadcnui.tsx" } ] }