Footer
ブランド、リンクのグループ、メタ情報を持つサイトのフッターです。ドキュメントのフッターはこれを使います。
インポート
「インポート」セクションimport { Footer, FooterBrand, FooterBrandName, FooterBrandDescription, FooterNav, FooterGroup, FooterGroupLabel, FooterLink, FooterMeta, FooterCopyright,} from "@pelagornis/page/components";上のプレビューはこのファイルを描画したものです。src/components/ にコピーして使い始めてください。
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> );}MDX で使う
「MDX で使う」セクションFooter は React の状態を共有する複数のパーツで構成されます。MDX に書いた子要素はそれぞれ別のアイランドとして描画されるため、パーツ同士がつながりません。上の例のように .tsx ファイルで組み立て、そのファイルをインポートしてください。
---title: Example---
import FooterExample from "../../components/FooterExample";
<FooterExample client:load />client:load はページの読み込み時にアイランドをハイドレートします。ページの下の方にあるコンテンツには client:visible を使ってください。
Markdoc で使う
「Markdoc で使う」セクションMarkdoc のタグは Astro コンポーネントを描画しますが、このコンポーネントにはクライアントの状態が必要です。例をハイドレートする .astro ファイルで包み、そのファイルをタグとして登録してください。
---import FooterExample from "../FooterExample";---
<FooterExample client:load />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, }, },});{% footer-example /%}コンポーネントを構成するパーツと、それぞれが描画する data-refineui のロールです。
| パーツ | ロール |
|---|---|
root | footer |
brand | footer-brand |
brand_description | footer-brand-description |
brand_name | footer-brand-name |
copyright | footer-copyright |
explore | footer-explore |
group | footer-group |
group_label | footer-group-label |
link | footer-link |
locale | footer-locale |
logo | footer-logo |
meta | footer-meta |
meta_end | footer-meta-end |
nav | footer-nav |
social | footer-social |
コンポーネントがスタイルを当てる状態です。コンポーネントの状態は data 属性として公開されます。
| 種類 | 状態 |
|---|---|
| 疑似クラス | focus-visible |
- デザインのガイドとトークンの詳細は RefineUI · Footer を参照してください。
- 共通のルールは MDX で使う と Markdoc で使う を参照してください。