Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Example: overriding default components #223

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

nalesnichok
Copy link

@nalesnichok nalesnichok commented Jul 6, 2022

Overriding Redocly Portal components

This PR has examples of components that can be overridden in Redocly Portal.

To override a component, create a _override folder and put a corresponding override into it. Developer server restart is needed when adding a new component override.

Some examples just mirror our default implementations and some adds some modifications. Check out comments inside each example for more details.

List of components

  • layouts/Markdown.tsx - defines layout for markdown content. Useful when you need to change layout based on current URL (e.g. different layout for /blog pages)
  • layouts/Sidebar.tsx - defines layout for any content with sidebar menu.
  • App.tsx - top-level app wrapper. Useful when you need to add some global providers or global elements.
  • Footer.tsx - footer component.
  • MenuItem.tsx - single sidebar menu item.
  • NavBar.tsx - navbar component.
  • SearchInput.tsx - search input.
  • SearchResults.tsx - search results. Useful for additional filtering/grouping search results.

Overriding API reference docs behaviour

See docs here: https://redocly.com/docs/developer-portal/guides/reference-docs-hooks/

Screenshot of the result

image

@RomanHotsiy RomanHotsiy changed the title Custom overrides Example of custom overrides Jul 7, 2022
Copy link
Member

@RomanHotsiy RomanHotsiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added isActive example

_override/NavBar.tsx Outdated Show resolved Hide resolved
_override/NavBar.tsx Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants