Docs · Using components
Next.js and SSR
All 228 components already carry the "use client" directive. Use them from the App Router without wrapping them.
On this page
App Router
Every component starts with "use client". That means you can import it from a Server Component, like any client component, without creating an intermediate file:
// app/page.tsx (Server Component: no "use client")
import { DecipherText } from "furin-ui";
export default function Page() {
return (
<h1>
<DecipherText text="Hello from Next.js" />
</h1>
);
}With shadcn the import becomes @/components/furin/decipher-text/DecipherText and everything else stays the same. In the Pages Router, import them like any other React component.
Styles
Each component imports its CSS. If you'd rather load them all in one place, import the full stylesheet in your layout:
import "furin-ui/estilos.css";Functions as props
A Server Component can't pass functions to a client component. If the component takes a callback (for example onRing in Wind Chime), use it from a client file:
"use client";
import { ChimeBell } from "furin-ui";
export function Alert() {
return <ChimeBell onRing={(intensity) => console.log(intensity)} />;
}What happens on the server
- Components are built to render on the server without touching
windowordocument. Listeners, canvases and WebGL start on mount in the browser. - The server HTML includes the component's container; Aurora, for example, includes a static fallback background until the effect starts.
- Furin's own site server-renders the page of each of its components when it's built, and it works.
Spot a mistake or something missing? Email us at contacto@furin.dev.