Versions
The <Versions> component displays different content based on version selection. Users can switch between versions using a dropdown, and the selected version persists in the URL query parameter.
For versioning your entire docs site, use site-wide versioning. You can use site-wide versioning and the <Versions> component independently or together.
Usage
This content is for version 2.0 (the default). When selected, the URL will show ?v=v2.0.
Variants
Nested components
You can include any content inside each version, including code blocks, callouts, and other components.
Version 2.0 includes breaking changes. See the migration guide.
Custom query parameter
By default, the selected version is stored in the URL using the v query parameter. You can customize this with the paramName prop to avoid conflicts when using multiple <Versions> components on the same page.
Content for the current SDK version. When selected, the URL will show ?sdk-version=current.
Properties
<Versions> properties
The query parameter name used to store the selected version in the URL.
Additional CSS classes to apply to the versions container.
<Version> properties
The version identifier. Must be unique within the <Versions> component. This value is used in the URL query parameter.
The display title shown in the dropdown. If not specified, the version value is used.
Whether this version should be selected by default when no version is specified in the URL.
The content to display when this version is selected. Can include text, Markdown, and components.
Additional CSS classes to apply to the version content.