Rasengan Logo
Rasengan Logo
  • Docs
  • Blog
  • Showcase
  • Support us
Using stable versionv1.2.0
Documentation
Packages
Templates
Rasengan UI Kit
Using stable versionv1.2.0
Documentation
Packages
Templates
Rasengan UI Kit

CORE CONCEPTS

Static Assets

Rasengan.js allows you to serve static files like images, fonts, and other assets from a special folder called public.

Using the public Folder

Any file placed inside the public folder is automatically available at the base URL (/). This means you don’t need to import assets manually or use special loaders—just reference them directly in your code.

Example

If you have an image located at:

txt/public/avatars/1.png

You can access it in your browser at:

txt/avatars/1.png

And use it in your code like this:

src/components/Avatar.jsx
jsximport { Image } from "@rasenganjs/image"; export function Avatar({ id, alt }) { return <Image src={`/avatars/${id}.png`} alt={alt} width={64} height={64} />; }

Best Practices

  • Store all static assets inside the public folder to keep them easily accessible.
  • Use relative paths (/your-file.png) instead of importing images directly.
  • Optimize images to reduce load times and improve performance.

This feature makes it easy to serve assets without additional configuration! 🚀

Metadata
React Compiler

ON THIS PAGE

Using the public Folder
Example
Best Practices
Rasengan Logo
Rasengan Logo

Resources

  • Docs
  • Packages
  • Blog
  • Showcase
  • Support us

Community

  • Github
  • X (Twitter)

Subscribe to the Newsletter

Stay informed to the news about rasengan.js including new releases, events, etc...

© 2024-2026 Rasengan Labs, All rights reserved.