Skip to content
Page

Footer

Site footer with brand, link groups, and meta. The docs footer uses it.

import {
Footer,
FooterBrand,
FooterBrandName,
FooterBrandDescription,
FooterNav,
FooterGroup,
FooterGroupLabel,
FooterLink,
FooterMeta,
FooterCopyright,
} from "@pelagornis/page/components";

The preview above renders this file. Copy it into src/components/ to start from it.

src/components/FooterExample.tsx
import {
Footer,
FooterBrand,
FooterBrandDescription,
FooterBrandName,
FooterCopyright,
FooterGroup,
FooterGroupLabel,
FooterLink,
FooterMeta,
FooterNav,
} from "@pelagornis/page/components";
export default function FooterDemo() {
return (
<Footer className="w-full">
<FooterBrand>
<FooterBrandName>Page</FooterBrandName>
<FooterBrandDescription>A Starlight theme built on RefineUI.</FooterBrandDescription>
</FooterBrand>
<FooterNav>
<FooterGroup>
<FooterGroupLabel>Docs</FooterGroupLabel>
<FooterLink href="/guides/getting-started/">Getting started</FooterLink>
<FooterLink href="/components/">Components</FooterLink>
</FooterGroup>
<FooterGroup>
<FooterGroupLabel>Project</FooterGroupLabel>
<FooterLink href="https://github.com/pelagornis/starlight-theme-page">GitHub</FooterLink>
</FooterGroup>
</FooterNav>
<FooterMeta>
<FooterCopyright>© Pelagornis</FooterCopyright>
</FooterMeta>
</Footer>
);
}

Footer is composed from parts that share React state. Children written in MDX are rendered as separate islands, so the parts can’t reach each other. Put the composition in a .tsx file, like the example above, and import that file instead.

src/content/docs/example.mdx
---
title: Example
---
import FooterExample from "../../components/FooterExample";
<FooterExample client:load />

client:load hydrates the island on page load. Use client:visible for content far down the page.

Markdoc tags render Astro components, and this one needs client state. Wrap the example in an .astro file that hydrates it, then register that file as a tag.

src/components/markdoc/FooterExample.astro
---
import FooterExample from "../FooterExample";
---
<FooterExample client:load />
markdoc.config.mjs
import { component, defineMarkdocConfig } from "@astrojs/markdoc/config";
import starlightMarkdoc from "@astrojs/starlight-markdoc";
import pageMarkdoc from "@pelagornis/page/markdoc";
export default defineMarkdocConfig({
extends: [starlightMarkdoc(), pageMarkdoc()],
tags: {
"footer-example": {
render: component("./src/components/markdoc/FooterExample.astro"),
selfClosing: true,
},
},
});
src/content/docs/example.mdoc
{% footer-example /%}

Parts of the component and the data-refineui role each one renders.

PartRole
rootfooter
brandfooter-brand
brand_descriptionfooter-brand-description
brand_namefooter-brand-name
copyrightfooter-copyright
explorefooter-explore
groupfooter-group
group_labelfooter-group-label
linkfooter-link
localefooter-locale
logofooter-logo
metafooter-meta
meta_endfooter-meta-end
navfooter-nav
socialfooter-social

States the component styles. Component states are exposed as data attributes.

KindStates
Pseudofocus-visible