Some Examples » 17. Page: Indicators
17. Page: Indicators
(You can also tap the indicators to directly go to a page.)
Code component
We use React’s useState()
hook to keep track of the current page.
Pro tip: When using the <Page>
component in a React project (like in the CodeSandbox above), set the box-sizing
of all elements to border-box
. Like this, for instance:
<Page>
box-sizing
, CSS universal selector (*
)
Code overrides
Here I used Framer’s createStore()
to communicate between the overrides.
The Indicators()
override is attached to the parent frame of the indicators. It maps through its children
(the five indicators) and clones them, giving them each an animate
to the correct opacity
and an onTap()
event so that you can tap them to change the page.