cult/ui

repository·main·Indexed 27 days ago

https://github.com/nolly-studio/cult-ui

An open-source library of accessible, copy-pasteable UI components and advanced AI agent patterns for developers using Next.js, AI SDK, and Tailwind CSS. It features a comprehensive registry of core UI components (such as 3D carousels, dynamic islands, and shader effects), 92+ AI Agent patterns with interactive previews, and production-ready full-stack starter templates including Logo GPT and Manifest.

Tokens
86.5K
Snippets
234
Records
394
Agent score
88%

What's inside cult-ui

  1. Overview of cult/ui

    main
    cult/ui provides accessible and customizable UI components designed to be copied and pasted into applications. It is an open-source project intended to help developers build their own component libraries. The ecosystem includes AI Agent patterns, premium full-stack blocks, and production-ready starter templates.
  2. Understand the Cult UI distribution model

    main

    Cult UI is not a traditional npm component library. It is an extension of the shadcn/ui ecosystem designed to provide motion-rich, niche components.

    Instead of installing a monolithic package, components are distributed as source code via a registry. You add components to your project by using the shadcn registry CLI or by copying the source directly into your codebase. This approach ensures you have full ownership and can customize the implementation and styling without being constrained by a dependency layer.

  3. Use the MorphSurface component

    main

    The MorphSurface component is an interactive surface that morphs between different states (e.g., a button and a textarea). It is designed for high-fidelity interaction, featuring smooth layout transitions and automatic focus management.

    Key Behaviors:

    • Auto-focus: The component automatically focuses the textarea when it is opened.
    • Dismissal: Clicking outside the component will close it.
    • Form Handling: When used within a form, submission extracts FormData from the form element.
    • Success Feedback: A success indicator is displayed for 1.5 seconds following a successful submission.
    • Animations: Uses layoutId animations for smooth morphing transitions.
    • Theming: Works seamlessly in both light and dark modes.
  4. Use the Typewriter component

    main

    The Typewriter component creates a repeating typewriter effect by cycling through an array of strings.

    Props:

    • texts: An array of strings to be typed out sequentially.
    • delay: The delay between characters or sequences (number).
    • baseText: A static string that precedes the animated text (e.g., a prefix).

    Example usage:

    const texts = [
      "Testing 124",
      "Look at newcult.co",
      "and check gnow.io",
      "Sick af",
    ]
    
    export default function TypewriterDemo() {
      return (
        <IosOgShellCard>
          <div className="ml-auto px-4 py-2 mb-3 text-white bg-blue-500 rounded-2xl">
            <p className="text-sm md:text-base font-semibold text-base-900 truncate">
              <Typewriter texts={texts} delay={1} baseText="Yo " />
            </p>
          </div>
        </IosOgShellCard>
      )
    }
  5. Configure components.json via CLI

    main

    When running npx cult-ui@latest init, you will be prompted to configure your components.json file. You should provide answers for the following prompts:

    • TypeScript: Recommended (yes/no)
    • Style: (e.g., Default)
    • Base color: (e.g., Slate)
    • Global CSS file: (e.g., src/index.css)
    • CSS variables for colors: (yes/no)
    • Import alias for components: (e.g., @/components)
    • Import alias for utils: (e.g., @/lib/utils)
    • React Server Components: (yes/no)
  6. Install the FractalDotGrid component

    main

    You can install the FractalDotGrid component using the shadcn CLI or by manual installation.

    CLI Installation: Run the following command to add the component directly to your project:

    Manual Installation:

    1. Copy the component source code from the Cult UI registry.
    2. Paste it into your project.
    3. Update the import paths to match your local project structure.
    npx shadcn@latest add https://cult-ui.com/r/bg-animated-fractal-grid.json