Skip to content

Commit ce9c886

Browse files
authored
Merge pull request #11435 from ncoden/docs/motion-ui-components
docs: add section about plugins options and improve examples in Motion UI docs
2 parents 3bbc707 + bd4bf11 commit ce9c886

File tree

1 file changed

+42
-22
lines changed

1 file changed

+42
-22
lines changed

docs/pages/motion-ui.md

+42-22
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,16 @@ library:
66
docs: https://github.com/zurb/motion-ui/tree/master/docs
77
---
88

9-
Motion UI is a standalone library that powers the transition effects used in a number of Foundation components, including [Toggler](toggler.html), [Reveal](reveal.html), and [Orbit](orbit.html). The transitions are powered by special transition classes that the Motion UI Sass creates. For example, here are two instances of Toggler—one using fade classes (`.fade-in` and `.fade-out`), and one using slide classes (`.slide-in-down` and `.slide-out-up`).
9+
Motion UI is a standalone library that powers the transition effects used in a number of Foundation components, including [Toggler](toggler.html), [Reveal](reveal.html), and [Orbit](orbit.html).
1010

11-
```html
12-
<div data-toggler data-animate="fade-in fade-out" class="callout secondary">
13-
<p>This panel fades.</p>
14-
</div>
15-
16-
<div data-toggler data-animate="slide-in-down slide-out-up" class="callout secondary">
17-
<p>This panel slides.</p>
18-
</div>
19-
```
20-
21-
<button type="button" class="button" data-toggle="motion-example-1">Fade</button><button type="button" class="button" data-toggle="motion-example-2">Slide</button>
22-
<div class="grid-x grid-margin-x">
23-
<div class="cell small-6">
24-
<div data-toggler data-animate="fade-in fade-out" class="callout secondary ease" id="motion-example-1">
25-
<p>This panel <strong>fades</strong>.</p>
26-
</div>
27-
</div>
28-
<div class="cell small-6">
29-
<div data-toggler data-animate="slide-in-down slide-out-up" class="callout secondary ease" id="motion-example-2">
30-
<p>This panel <strong>slides</strong>.</p>
31-
</div>
11+
<div class="text-center">
12+
<button type="button" class="button" data-toggle="motion-header-example">Animate!</button>
13+
<div data-toggler data-animate="fade-in fade-out" id="motion-header-example" style="display: none;">
14+
<img src="/assets/img/generic/rectangle-7.jpg" style="width: 100%;">
3215
</div>
3316
</div>
3417

18+
3519
---
3620

3721
## Installing
@@ -78,6 +62,42 @@ Or, another way to start using Motion UI is through a CDN.
7862

7963
---
8064

65+
## Usage in Components
66+
67+
Various Foundation components provide options for to use Motion UI animations when changing state. Here are the options for each plugin that support Motion UI:
68+
- [Orbit](orbit.html): `data-animate`
69+
- [Reveal](reveal.html): `data-animation-in`, `data-animation-out`
70+
- [Toggler](toggler.html): `data-animate`
71+
- [Responsive Toggler](responsive-navigation.html): `data-animate`
72+
73+
For example, here are two instances of Toggler&mdash;one using fade classes (`.fade-in` and `.fade-out`), and one using slide classes (`.slide-in-down` and `.slide-out-up`). See all availaible classes in [build-in transitions](#built-in-transitions) below.
74+
75+
```html
76+
<div data-toggler data-animate="fade-in fade-out" class="callout secondary">
77+
<p>This panel fades.</p>
78+
</div>
79+
80+
<div data-toggler data-animate="slide-in-down slide-out-up" class="callout secondary">
81+
<p>This panel slides.</p>
82+
</div>
83+
```
84+
85+
<button type="button" class="button" data-toggle="motion-example-1">Fade</button><button type="button" class="button" data-toggle="motion-example-2">Slide</button>
86+
<div class="grid-x grid-margin-x">
87+
<div class="cell small-6">
88+
<div data-toggler data-animate="fade-in fade-out" class="callout secondary ease" id="motion-example-1">
89+
<p>This panel <strong>fades</strong>.</p>
90+
</div>
91+
</div>
92+
<div class="cell small-6">
93+
<div data-toggler data-animate="slide-in-down slide-out-up" class="callout secondary ease" id="motion-example-2">
94+
<p>This panel <strong>slides</strong>.</p>
95+
</div>
96+
</div>
97+
</div>
98+
99+
---
100+
81101
## Built-in Transitions
82102

83103
Motion UI includes more than two dozen built-in transition classes. They can be enabled by adding this line to your Sass file, after you've imported the library:

0 commit comments

Comments
 (0)