🚧 Rspress 2.0 document is under development
close

LastUpdated eject-only

Warning

This is an eject-only component, designed specifically for wrap/eject, and is not recommended for direct use in MDX files

LastUpdated displays the last update time of the current page.

Usage

index.mdx
import { LastUpdated } from '@rspress/core/theme';

<LastUpdated />;

This component does not accept any props. It automatically reads the last update time from the page metadata.

Enable lastUpdated in rspress.config.ts:

rspress.config.ts
import { defineConfig } from '@rspress/core';

export default defineConfig({
  themeConfig: {
    lastUpdated: true,
  },
});

When lastUpdated is enabled, the component will automatically read and format the page metadata for display.

To customize the label or formatting, run rspress eject LastUpdated and edit theme/components/LastUpdated/index.tsx.

Tip

If lastUpdated: true is not configured in the default theme, install and register @rspress/plugin-last-updated.