Use static files with your component

Static files can be used for a number of purposes with Component Service. For instance, you can use static files as input, CSS, or content such as images.

Patterns for using static files

There are different approaches to using static files with your components. With Component Service you can:

  • Serve your components purely as HTML, with client-side CSS and JavaScript added by your global template.

    OR

  • Deliver the CSS and JavaScript within your component, and reference it from your global template.

Referencing external static files

If you do not want to manage your client-side CSS, JavaScript and other static files within your components, you can leave them out and apply styling and scripts with your global templates.

This approach is useful if you are using a global design system or design approach, and want to manage your global styling centrally. This method is especially useful when your design system is made up of many components. There is less benefit in trying to make your components self-contained if they will be part of an overarching design approach.