Samples are reusable pieces of HTML content defined within a .xml or .citron file. You can make as many samples and files as you want. Here's how to create one:
Replace "hello_world.xml" with the path to your .xml file containing the sample definitions.
Step 3 - Using Samples
Once imported, you can place your sample anywhere in the body of your HTML document by using the <sample> tag with the name attribute matching the name of your sample:
This will render the "Hello World" sample wherever the <sample> tag is placed. Like so:
Website displaying our Hello World sample
Keep in mind that nesting sample elements within eachother might cause issues.
Conclusion
Thank you for taking the time to learn about CitronJS! We hope this guide has helped you get started on your journey with our library.
Remember, the best way to learn is by doing, so don't hesitate to experiment and create your own samples.