c8r / x0

Document & develop React components without breaking a sweat

Home Page:https://compositor.io/x0/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different type of layouts?

huy-qn opened this issue · comments

I noted that in the document this is mentioned
Files that begin with an underscore (e.g. _layout.js) will be ignored.

So, if I create a file called _app.js I can have one main layout by adding

& into it. What if I want to create a different layout with different components? Can we do that with x0?

How does x0 know what type of layout I am using?

You can render anything from the _app component. We're working on more docs, but here's an example of switching between layout based on a route's props: https://compositor.io/x0/components/SidebarLayout#page-specific-layouts

Thank you very much!