Footer
组件
网站的页脚区域。你可以为默认页脚指定内容。
Option | Type | Default Value | Description |
---|---|---|---|
children | ReactNode | 'MIT ${new Date().getFullYear()} © Nextra.' | 页脚的内容。 |
className | string | CSS 类名。 |
示例
你可以通过将内容作为 Footer
组件的 children
传递来添加内容,比如版权信息:
app/layout.jsx
import { Footer, Layout } from 'nextra-theme-docs'
export default function MyLayout({ children, ...props }) {
return (
<Layout>
{children}
<Footer>
MIT {new Date().getFullYear()} ©{' '}
<a href="https://nextra.site" target="_blank">
Nextra
</a>
.
</Footer>
{children}
</Layout>
)
}
Toggle Visibility
You can toggle visibility of the <Footer>
on the specific pages by setting theme.footer
property in the _meta.js
file:
_meta.js
export default {
'my-page': {
theme: {
footer: false // Hide footer on this page
}
}
}
Last updated on