Skip to content

Commit

Permalink
Merge pull request #1938 from FlowFuse/add-handbook-frontend-layouts-…
Browse files Browse the repository at this point in the history
…page

Add a layouts description in the frontend handbook
  • Loading branch information
joepavitt authored Apr 17, 2024
2 parents b4f5468 + 9bd2d23 commit dabee1b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/handbook/development/frontend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ A collection of how-to's and best practice guides for FlowFuse's front-end devel

- [Data Attributes](./data-attributes.md)
- [Services](./services.md)
- [Testing](./testing.md)
- [Testing](./testing.md)
- [Layouts](./layouts.md)
55 changes: 55 additions & 0 deletions src/handbook/development/frontend/layouts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Front-End Layouts
---

# Layouts

The frontend has 4 layouts which can be found in `frontend/src/layouts`:
- Platform
- Plain
- Page
- Box

## Layout Variants

### Platform
The platform layout serves as the primary structure throughout the application.

It comprises a page header and side navigation, offering features such as platform banners, toast notifications, dialog/modals, and interview popups.

Most importantly, it is designed to be mobile-friendly.

![Layouts](../../images/development/layout-platform.png)
_Screenshot of the FlowFuse platform to show the areas controlled by the Platform (green) layout and the child, Page (red) layout._

#### Page
The page layout is used primarily as a wrapper for Vue pages and has support for a header slot among a default one.

### Plain
The plain layout serves as a blank structure primarily used for embedded pages or any other structures that don't require navigation or headers (ex: error pages).

Has support for alerts and dialog/modals.

### Box
The box layout is used in the initial Setup phase and consists of a boxed layout which guides you through the required steps in configuring the Flow Fuse Application.

![Layouts](../../images/development/layout-box.png)
_Screenshot of the FlowFuse platform with a page using the "Box" layout._

## Layout Selection

Layout selection is done via a `layout` meta attribute defined on the page route.

```javascript
{
path: '/instance/:id',
name: 'Instance',
component: Instance,
meta: {
title: 'Instance - Overview',
layout: 'plain' // 'platform'/'modal'/'plain'
},
}
```

If the layout meta attribute is missing or an invalid value is passed, the application will default to the platform layout.
Binary file added src/handbook/images/development/layout-box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dabee1b

Please sign in to comment.