You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/transition.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,18 @@ transition path: :page1_path, text: 'Click me for a transition'
30
30
31
31
If no text is present, the transition component expects a block that it then *yields* the usual way.
32
32
33
+
### Active class
34
+
35
+
The `transition` component automatically gets the `active` class on the clientside when the current path equals the target path.
36
+
37
+
When a sub page of a parent `transition` component is currently active, the parent `transition` component gets the `active-child` class. A sub page is recognized if the current path is included in the target path of the parent `transition` component:
38
+
39
+
Parent target: `/some_page`
40
+
41
+
Currently active: `/some_page/child_page` --> Parent gets `child-active`
42
+
43
+
Query params do not interfere with this behavior.
44
+
33
45
## Examples
34
46
35
47
The transition core component renders the HTML `<a>` tag and performs a page transition
0 commit comments