Skip to main content

Configuration

Enabled Actions

Control which actions appear in the dropdown menu. This is useful for private documentation sites where AI tool links won't work.

module.exports = {
plugins: [
[
'docusaurus-plugin-copy-page-button',
{
// Only show copy and view actions
enabledActions: ['copy', 'view'],
},
],
],
};

Available Actions

ActionDescription
copyCopy page as Markdown
viewView as Markdown in new tab
chatgptOpen in ChatGPT
claudeOpen in Claude
geminiOpen in Gemini

Default: All actions are enabled: ['copy', 'view', 'chatgpt', 'claude', 'gemini']

Markdown URL Routes

Markdown URL routes are optional. Enable them when you want each generated docs page to also be available as plain markdown:

module.exports = {
plugins: [
[
'docusaurus-plugin-copy-page-button',
{
generateMarkdownRoutes: true,
},
],
],
};

For a page at https://your-docs.com/docs/intro, the production build writes a sibling markdown file served at https://your-docs.com/docs/intro.md. When enabled, the ChatGPT, Claude, and Gemini actions use the .md URL so AI tools can fetch the clean markdown page directly.

Example Configurations

// Only copy functionality
enabledActions: ['copy']

// Copy and view only (no AI tools)
enabledActions: ['copy', 'view']

// Only AI tools
enabledActions: ['chatgpt', 'claude', 'gemini']

Custom Styling

Customize the appearance of the button and dropdown:

module.exports = {
plugins: [
[
'docusaurus-plugin-copy-page-button',
{
customStyles: {
button: {
className: 'my-custom-button',
style: {
backgroundColor: '#4CAF50',
color: 'white',
borderRadius: '8px',
},
},
dropdown: {
className: 'my-custom-dropdown',
style: {
backgroundColor: '#f8f9fa',
border: '2px solid #4CAF50',
},
},
dropdownItem: {
style: {
padding: '12px 20px',
fontSize: '16px',
},
},
container: {
className: 'my-button-container',
},
},
},
],
],
};

Style Targets

TargetDescription
buttonThe main copy page button
dropdownThe dropdown menu
dropdownItemIndividual items in the dropdown
containerThe wrapper container around the button

Each target accepts className (string) and style (React style object).

Note: Positioning styles (position, top, right, bottom, left, zIndex, transform) on the button are automatically applied to the container.