diff --git a/docs/pages/tabs.md b/docs/pages/tabs.md index 01798bc511..9f2c1c56ee 100644 --- a/docs/pages/tabs.md +++ b/docs/pages/tabs.md @@ -138,4 +138,50 @@ Add the attribute `data-active-collapse="true"` to a tabstrip to collapse active

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+``` + +--- + +## Tabs and URLs + +### Browser history + +The current state of the tabset is now recorded by adding a hash with the tab panel ID to the browser URL when a tab is opened. By default, tabs replace the browser history. Modify this behavior by using attribute `data-update-history="true"` to *append* to the browser history. In the latter case the browser back button will track each click that opens a tab panel. + +By using deep linking (see below), the open state of a page's tabset may be shared by copy-pasting the browser URL. + +### Deep linking + +Add the attribute `data-deep-link="true" to a tabstrip to allow anchoring to and opening a tab panel at page load. + +```html_example + + +
+
+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+
+
+

Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim. Phasellus molestie magna non est bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus.

+
+
+ +
+
+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+
+
+``` + +For example, http://example.com/#panel3d will open the third tab panel at page load. + +When linking directly to a tab panel, it might not be obvious that the content appears within a tab panel. An additional attribute `data-deep-link-smudge` rolls the page up slightly after deep linking (to a horizontal tabset) so that the tabstrip is at the top of the viewport. + +```html_example +