Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an "active" parameter to tab shortcode to set default active tab #75

Open
cybardev opened this issue Jan 11, 2025 · 2 comments
Open

Comments

@cybardev
Copy link
Contributor

In this line, it's hardcoded to set the first tab to be active:

class="tab-content-panel {{ cond (eq $idx 0) `active` `` }}"

Would be nice if this was the default behaviour unless an active or active="true" param was set in the shortcode. Like so (2nd tab is active):

{{< tabs "tab-group-name" >}}

{{< tab "first" >}}
First Tab
{{< /tab >}}

{{< tab "second" active="true" >}}
Second Tab
{{< /tab >}}

{{< tab "third" >}}
Third Tab
{{< /tab >}}

{{< /tabs >}}
@tfsomrat
Copy link
Contributor

Hey @cybardev, You can make a PR to contribute to this open-source project. I'll merge it.

@cybardev
Copy link
Contributor Author

cybardev commented Jan 12, 2025

Yep, I want to do it but am occupied for the next couple of days weeks. Will get on it afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants