Install dependencies
Server-side rendering requires the component and html-template packages:All necessary packages are included in the main
remix package.Create a render utility
Set up a helper function to render components to HTML streams:The
app/utils/render.ts
renderToStream function converts your components into a streaming HTML response, enabling faster time-to-first-byte.Create a document layout
Build a base HTML document component:The
app/layout.tsx
css function allows you to write inline styles with full TypeScript support.Add CSS styling
Use the The
css helper for scoped, type-safe styles:mix prop combines multiple style objects. Falsy values are ignored, making conditional styles easy.Add interactive features with Frames
Use Frames to embed dynamic, auto-updating content:Create the frame endpoints:
app/pages/dashboard.tsx
app/router.ts
Component Best Practices
Extract reusable components
app/components/card.tsx
Type your props
Always use TypeScript interfaces for component props to get autocomplete and type checking.Use semantic HTML
Use proper HTML elements (<article>, <section>, <nav>) for better accessibility and SEO.