Blocks
Complex Component
A complex component showing hooks, libs and components.
Preview
Loading...
import { cache } from "react";import { PokemonCard } from "@/registry/axon/blocks/complex-component/components/pokemon-card";import { getPokemonList } from "@/registry/axon/blocks/complex-component/lib/pokemon";const getCachedPokemonList = cache(getPokemonList);export default async function ComplexComponentDemo() { const pokemons = await getCachedPokemonList({ limit: 12 }); if (!pokemons) { return null; } return ( <div className="mx-auto w-full max-w-2xl px-4"> <div className="grid grid-cols-2 gap-4 py-10 sm:grid-cols-3 md:grid-cols-4"> {pokemons.results.map((p) => ( <PokemonCard key={p.name} name={p.name} /> ))} </div> </div> );}Installation
CLI
npx shadcn@latest add @emberui/complex-componentyarn shadcn@latest add @emberui/complex-componentpnpm dlx shadcn@latest add @emberui/complex-componentbunx --bun shadcn@latest add @emberui/complex-component