Switcher
Switcher allows you to display different views at different breakpoints.
To create it's instance, use the multiswitcher
type in designer.
let elements = [
{
type: "multiswitcher"
}
];
Options
breakpoints
- array of breakpoints
Setting views
at
- breakpoint, set the first one to0px
.view
- any view (like Text, Button...)
Consider the following example:
- between
0px - 700px
the view withText("A")
will be displayed. - between
700px - 800px
the view withText("B")
will be displayed. - between
700px - 800py
the view withText("C")
will be displayed.
new MultiSwitcher()
.set({
breakpoints: [
{ at: "0px", view: new Text("A") },
{ at: "700px", view: new Text("B") },
{ at: "800px", view: new Text("C") },
]
}).render("#root");