Next.js Component Templates
Server Component Template
// app/components/ServerComponent.tsx
import { OASISServerClient } from '@oasis/webui-devkit-nextjs/server';
interface Props {
avatarId: string;
}
export default async function ServerComponent({ avatarId }: Props) {
const client = new OASISServerClient();
const data = await client.getData(avatarId);
return (
<div className="oasis-server-component">
<h3>{data.title}</h3>
<pre>{JSON.stringify(data, null, 2)}</pre>
</div>
);
}Client Component Template
Server Actions Template
API Route Template
Middleware Template
Priority Components
1. Server: AvatarDetailServer
2. Client: KarmaManagement
3. Hybrid: NFTGallery
Layout with Providers
Streaming and Suspense
Remaining Components
Last updated