Scroll back to top
Text successfully copied to clipboard!
import Component from '../../components/Component.astro'
, where `Component` refers to the name of the component you want to import.
Text successfully copied to clipboard!
<Component> Content goes here... </Component>
Notice how the component has two tags, one start tag and one end tag with a forward-slash. This allows us to insert content inside the element when supported.
Self-closing tags follow another convention:
Text successfully copied to clipboard!
<Component />
Now, the component only has one tag, essentially combining both the start and end tag. The component will still load, but we cannot insert any content inside it.
Depending on that state, the behavior of the component might be different. For example, let's take the `<DisplayEquation>` component. When declared with self closing tags, it will simply be displaying an equation that take up the entire width of the screen (or whichever element it's inside of):
Text successfully copied to clipboard!
<DisplayEquation title="Normalization to unit vector." id="rvv-eu1" background="True" equation="\\begin{aligned} \\hat{a} =\\frac{\\vec{a}}{a}\\end{aligned}"/>
Text successfully copied to clipboard!
<DisplayEquation title="Normalization to unit vector." id="rvv-eu2" background="True" equation="\begin{aligned} \\hat{a} =\\frac{\\vec{a}}{a}\\end{aligned}" derivation="True">
<p>Content goes here:</p>
<DisplayEquation equation="\\vec{v} = \\vec{\\omega} \\times \\vec{r}"/>
</DisplayEquation>
Type: Regular only
Options:Text successfully copied to clipboard!
<Section title="Example Page" id="example_page">
<p>Lorem ipsum.</p>
</Section>
Result:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nulla augue, interdum sed sapien non, dictum luctus risus. Maecenas pretium leo orci, condimentum vehicula libero scelerisque vel. Nulla hendrerit nunc a mauris elementum, id molestie augue dictum. Etiam convallis justo eu sem ultricies, sed ultricies tellus commodo. Nunc ac bibendum odio. Etiam non tincidunt mauris, vitae condimentum eros. Fusce id semper arcu, id dictum neque.
Type: Regular only
Options:Text successfully copied to clipboard!
<SubSection title="Example Subsection" id="example_subsection">
<p>Lorem ipsum.</p>
</SubSection>
Result:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nulla augue, interdum sed sapien non, dictum luctus risus. Maecenas pretium leo orci, condimentum vehicula libero scelerisque vel. Nulla hendrerit nunc a mauris elementum, id molestie augue dictum. Etiam convallis justo eu sem ultricies, sed ultricies tellus commodo. Nunc ac bibendum odio. Etiam non tincidunt mauris, vitae condimentum eros. Fusce id semper arcu, id dictum neque.
Type: Regular only
Options:Text successfully copied to clipboard!
<SubSubSection title="Example SubSubsection" id="example_subsubsection">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nulla augue, interdum sed sapien non, dictum luctus risus. Maecenas pretium leo orci, condimentum vehicula libero scelerisque vel. Nulla hendrerit nunc a mauris elementum, id molestie augue dictum. Etiam convallis justo eu sem ultricies, sed ultricies tellus commodo. Nunc ac bibendum odio. Etiam non tincidunt mauris, vitae condimentum eros. Fusce id semper arcu, id dictum neque.</p>
</SubSubSection>
Result:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nulla augue, interdum sed sapien non, dictum luctus risus. Maecenas pretium leo orci, condimentum vehicula libero scelerisque vel. Nulla hendrerit nunc a mauris elementum, id molestie augue dictum. Etiam convallis justo eu sem ultricies, sed ultricies tellus commodo. Nunc ac bibendum odio. Etiam non tincidunt mauris, vitae condimentum eros. Fusce id semper arcu, id dictum neque.
Type: Regular only
Options:Text successfully copied to clipboard!
<SubSubSubSection title="Example SubSubsection" id="example_subsubsubsection">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nulla augue, interdum sed sapien non, dictum luctus risus. Maecenas pretium leo orci, condimentum vehicula libero scelerisque vel. Nulla hendrerit nunc a mauris elementum, id molestie augue dictum. Etiam convallis justo eu sem ultricies, sed ultricies tellus commodo. Nunc ac bibendum odio. Etiam non tincidunt mauris, vitae condimentum eros. Fusce id semper arcu, id dictum neque.</p>
</SubSubSubSection>
Result:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nulla augue, interdum sed sapien non, dictum luctus risus. Maecenas pretium leo orci, condimentum vehicula libero scelerisque vel. Nulla hendrerit nunc a mauris elementum, id molestie augue dictum. Etiam convallis justo eu sem ultricies, sed ultricies tellus commodo. Nunc ac bibendum odio. Etiam non tincidunt mauris, vitae condimentum eros. Fusce id semper arcu, id dictum neque.
Type: Self-closing & Regular
Options:Self-closing:
Will simply display equation. Example:Text successfully copied to clipboard!
<DisplayEquation title="Normalization to unit vector." id="rvv-eu" background="True" equation="Equation here"/>
Result:
Regular:
But when in regular mode, whatever content we add inside of it will now be displayed inside the derivation menu:Text successfully copied to clipboard!
<DisplayEquation title="Normalization to unit vector." id="rvv-eu3" background="True" equation="Equation here" derivation="True">
<p>Derivation goes here:</p>
</DisplayEquation>
Result:
Type: Regular only
Options:Text successfully copied to clipboard!
<DisplayEquationCustom title="Moment of inertia of prism." id="prism" background="True" derivation="True">
<div class="w-100 d-flex flex-row">
<div class="w-50">
<InlineCanvas id="rcm-er-c" width="300" height="300" show_border="False" />
</div>
<div class="w-50">
<DisplayEquation equation="\\vec{r}_C = \\frac{\\ell_x}{2}\\hat{\\imath} + \\frac{\\ell_y}{2}\\hat{\\jmath}" />
</div>
</div>
<div slot="derivation">
<p>Derivation goes here:</p>
</div>
</DisplayEquationCustom>
Result:
Type: Self-closing only
Options:Text successfully copied to clipboard!
<p>
<InlineEquation equation="\\vec{F} = m\\vec{a}" /> is a very important equation you guys need to remember.
</p>
Result:
\( \\vec{F} = m\\vec{a} \) is a very important equation you guys need to remember.Type: Regular only
This element doesn't have options and follows the exact same naming convention everytime, don't forget to include `slot="cards"`:Text successfully copied to clipboard!
<SubSection title="Vectors">
<p>Vectors are really useful, they can be used in many ways and have fun properties.</p>
<CalloutContainer slot="cards">
... cards go here ...
</CalloutContainer>
</SubSection>
Type: Regular only
Options:Text successfully copied to clipboard!
<SubSection title="Vectors">
<p>Lorem ipsum.</p>
<CalloutContainer slot="cards">
<CalloutCard title="Extras!">
<p style="margin-bottom: 0px">Random image:</p>
<img src="https://picsum.photos/200" />
</CalloutCard>
<CalloutCard>
<p style="margin-bottom: 0px">Lorem ipsum.</p>
</CalloutCard>
</CalloutContainer>
</SubSection>
Result:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce nulla augue, interdum sed sapien non, dictum luctus risus. Maecenas pretium leo orci, condimentum vehicula libero scelerisque vel. Nulla hendrerit nunc a mauris elementum, id molestie augue dictum. Etiam convallis justo eu sem ultricies, sed ultricies tellus commodo. Nunc ac bibendum odio. Etiam non tincidunt mauris, vitae condimentum eros. Fusce id semper arcu, id dictum neque.
Extras!
Random image:
Did you know?
Lorem ipsum.
Type: Self-closing & Regular
Options:Self-closing:
Will just display the image. Example:Text successfully copied to clipboard!
<Image src="/Solid_Mechanics/Bending-Figures/Geometry.png" width="5"/>
Result:
Regular:
Anything contained within the `Image` tag will be treated as a caption. Example:Text successfully copied to clipboard!
<Image src="/Solid_Mechanics/Torsion-Figures/Equilibrium.png" width="3">
<p>
Wow that's a beautiful image
</p>
</Image>
Result: