Components
Zenith comes with a set of predefined components you can use to build your resume. You will usually import them directly within pages when using the component approach or within templates in template approach. Components can be:
- context agnostic - work within any page or template. Located in
src/components
. - context specific - work only within the context (web or pdf) theyβre made for. Located in
src/components/web
orsrc/components/pdf
.
All components have their props described directly in the component file using TypeScript types and JSDoc comments. However to gain a better understanding of how to use them, you can find a list of all Zenith components below. Click badges next to component names, to see their implementation in the repository.
Presentation components
Used directly within pages and templates to display UI not related to content collections.
Main layout
<BaseLayout /> π€· agnostic
Used as a base for creating context-specific layout components. It renders the basic HTML structure and sets up a base for theme customization.
<Layout /> π web π pdf
Used to wrap the whole content of each page. It provides the base layout, sets up global styles, renders page metadata, and contains components responsible for some additional features like theme switcher or analytics.
Sections
<Section /> π web π pdf
Used to group all elements belonging to one section. We recommend to build section content using <SectionTitle />
as the first child and <Subsection />
or list components described above as the rest of the children.
<SectionTitle /> π web π pdf
Displays provided text using styles defined for section titles. We recommend to use it as the first child of <Section />
component.
<Subsection /> π web π pdf
Used to group all elements belonging to one subsection. We recommend to place it within <Section />
component and build its content using <SubsectionTitle />
as the first child and list components described above as the rest of the children.
<SubsectionTitle /> π web π pdf
Displays provided text using styles defined for subsection titles. We recommend to use it as the first child of <Subsection />
component.
Section layout
<GridList /> π€· agnostic
Displays children in a grid layout. Use grit-template-column class to specify the number of columns or pass minColWidth
prop to determine it automatically. Use gap classes to customize the space between items.
<HorizontalList /> π€· agnostic
Displays children in a horizontal list. Use gap classes to customize the space between items.
<VerticalList /> π€· agnostic
Displays children in a vertical list. Use gap classes to customize the space between items.
UI enhancements
<Separator /> π€· agnostic
Displays a horizontal separator line. Use border-width, border-style, and border-color classes to customize the line style.
<Footer /> π pdf
Displays the footer with the provided text. Use it to provide data required law regulations but not important from the resume content perspective (e.g. GDPR notice).
Sidebar
<Sidebar /> π web
Displays a sidebar on the right side of the resume. Use <SidebarItem />
components as children to specify which items should be displayed in the sidebar.
<SidebarItem /> π web
Displays a single item in the sidebar. To work properly you need to pass an sectionId
property that matches the id
of the section you want to link to. It also requires a icon
and title
properties that will be displayed in the sidebar and accompanying tooltip.
Content components
Used directly within pages and templates to display content collection entries. Always receive an entry
property.
<Achievement /> π web π pdf
Displays entries from the achievements
collection.
<Basics /> π web π pdf
Displays entries from the basics
collection.
<BasicsLargeImage /> π web
Displays entries from the basics
collection. Entry must have an image
property to be displayed by this component.
<Education /> π web π pdf
Displays entries from the education
collection.
<Favorite /> π web π pdf
Displays entries from the favorites
collection.
<Interest /> π web π pdf
Displays entries from the interests
collection.
<Job /> π web π pdf
Displays entries from the jobs
collection.
<Metadata /> π web
Uses entries from the metadata
collection to configure the page metadata.
<Project /> π web π pdf
Displays entries from the projects
collection.
<Reference /> π web π pdf
Displays entries from the references
collection.
<Skill /> π web π pdf
Displays entries from the skills
collection.
Style components
Used directly within pages and templates to customize global styles. The import names are arbitrary, so we document ones used by default.
<Font /> π€· agnostic
Downloads and sets up fonts for headers and body text. We recommend to use Fontsource if you want to add your own fonts.
<DuskColors /> π€· agnostic
Sets up CSS variables for dusk (grayscale) colors. By default you can choose from 5 presets based on Tailwind grayscale shades.
<AccentColors /> π€· agnostic
Sets up CSS variables for accent colors. By default you can choose from 17 presets based on Tailwind color shades.
<ElementColors /> π€· agnostic
Sets up CSS variables that are actually used to style the components. As it is based on the dusk and accent colors, you need to set them up before this element.
Utility components
Used within other components to provide a particular functionality.
<Analytics /> π web
Sets up analytics services based on the provided environment variables.
<DateRange /> π€· agnostic
Displays date range in a human-readable format. Its result depends on the translations
and dateFormat
props from the global context;
<Details /> π web π pdf
Displays sets of label-value pairs. Used in some content components to display additional information about the entry.
<Icon /> π€· agnostic
Fetches and displays icons from Iconify or local icons stored at src/icons
. Always requires a name
property that should have an set:name
format for Iconify icons or be a filename for local icons.
<Img /> π€· agnostic
Displays an image based on the provided src
property. You can pass an imported image, path to the /public
directory (starting withΒ /
), or an authorized external URL.
<Linkable /> π€· agnostic
Used for elements that may be a link. It wraps the provided children with an <a>
tag if the href
property is provided or with a <span>
otherwise.
<Popover /> π web
Creates a popover that displays provided content when the element passed to the trigger
slot is clicked.
<RenderedContent /> π web π pdf
Renders content collection entriesβ content (markdown below the frontmatter) as HTML and provides its styles.
<ThemeSwitcher /> π web
Contains theme setup logic and (if configured through global context) displays a button that allows users to switch between light and dark themes.
Special components
<OpenGraph />
The default template used in src/pages/og
files to provide a base for Open Graph image generation. It shouldnβt be used anywhere else.