Usage Example
Examples
Here is a live demonstration of the extension with the new simplified syntax.
Using ARIA Labels for Better Accessibility
For improved screen reader support, you can provide descriptive ARIA labels that give more context than the short visual tab names:
Providing a Custom Legend
For cases where the auto-generated legend (e.g., “Choose programming language…”)
is not specific enough, you can provide a custom title for the entire tab group
using the :legend: option.
Source Code for Custom Legend
The following RST markup was used to create the above example:
.. filter-tabs:: :legend: Select Your Deployment Environment .. tab:: Staging (default) This panel shows configuration for the **staging** environment. It's used for testing before release. .. tab:: Production This panel shows configuration for the **production** environment. This is the live, user-facing setup.
Nested Tabs
You can nest filter-tabs directives to create more complex layouts.
Simply indent the inner tab set within a tab directive of the outer set.
Large Tab Groups
There is no fixed limit on the number of tabs in a group. The panel-visibility CSS is generated at build time, scaled exactly to the tabs present in each build. The following example shows 12 tabs — a realistic count for a library that ships official clients for many languages.
Note
Tab groups above 15 will trigger a build warning encouraging you to
consider restructuring. Groups above 20 are capped and produce a build
error. For truly large sets of alternatives, a toctree or a
comparison table is usually a better fit.
pip install acme-client
npm install acme-client
npm install acme-client
# Type declarations are bundled — no @types package needed.
go get github.com/acme/acme-client-go
# Cargo.toml
[dependencies]
acme-client = "1.0"
<!-- pom.xml -->
<dependency>
<groupId>com.acme</groupId>
<artifactId>acme-client</artifactId>
<version>1.0.0</version>
</dependency>
// build.gradle.kts
implementation("com.acme:acme-client:1.0.0")
dotnet add package Acme.Client
gem install acme-client
composer require acme/acme-client
// Package.swift
.package(url: "https://github.com/acme/acme-client-swift", from: "1.0.0")
# mix.exs
{:acme_client, "~> 1.0"}