Layout

Handling the overall layout of a page.

Specification

Size

The first level navigation is inclined left near a logo, and the secondary menu is inclined right.

  • Top Navigation (almost systems): the height of the first level navigation 64px, the second level navigation 48px.
  • Top Navigation(contents page): the height of the first level navigation 80px, the second level navigation 56px.
  • Calculation formula of a top navigation: 48+8n.
  • Calculation formula of an aside navigation: 200+8n.

Interaction rules

  • The first level navigation and the last level navigation should be distinguishable by visualization;
  • The current item should have the highest priority of visualization;
  • When the current navigation item is collapsed, the style of the current navigation item is applied to its parent level;
  • The left side navigation bar has support for both the accordion and expanding styles; you can choose the one that fits your case the best.

Visualization rules

Style of a navigation should conform to its level.

  • Emphasis by colorblock

When background color is a deep color, you can use this pattern for the parent level navigation item of the current page.

  • The highlight match stick

When background color is a light color, you can use this pattern for the current page navigation item; we recommend using it for the last item of the navigation path.

  • Highlighted font

From the visualization aspect, a highlighted font is stronger than colorblock; this pattern is often used for the parent level of the current item.

  • Enlarge the size of the font

12px14px is a standard font size of navigations,14px is used for the first and the second level of the navigation. You can choose an appropriate font size regarding the level of your navigation.

Component Overview

  • Layout: The layout wrapper, in which Header Sider Content Footer or Layout itself can be nested, and can be placed in any parent container.
  • Header: The top layout with the default style, in which any element can be nested, and must be placed in Layout.
  • Sider: The sidebar with default style and basic functions, in which any element can be nested, and must be placed in Layout.
  • Content: The content layout with the default style, in which any element can be nested, and must be placed in Layout.
  • Footer: The bottom layout with the default style, in which any element can be nested, and must be placed in Layout.

Based on flex layout, please pay attention to the compatibility.

Examples

Header
Content
Header
Sider
Content
Header
Content
Sider
Sider
Header
Content

Basic Structure

Classic page layouts.

expand code expand code
Content

Custom trigger

If you want to use a customized trigger, you can hide the default one by setting :trigger="null".

expand code expand code
Home/List/App/
Content

Header Sider 2

Both the top navigation and the sidebar, commonly used in application site.

expand code expand code
Home/List/App/
Content

Header-Sider

Both the top navigation and the sidebar, commonly used in documentation site.

expand code expand code
content

Responsive

Layout.Sider supports responsive layout.

Note: You can get a responsive layout by setting breakpoint, the Sider will collapse to the width of collapsedWidth when window width is below the breakpoint. And a special trigger will appear if the collapsedWidth is set to 0.

expand code expand code

Fixed Sider

When dealing with long content, a fixed sider can provide a better user experience.

expand code expand code

Fixed Header

Fixed Header is generally used to fix the top navigation to facilitate page switching.

expand code expand code

Sider

Two-columns layout. The sider menu can be collapsed when horizontal space is limited.
Generally, the mainnav is placed on the left side of the page, and the secondary menu is placed on the top of the working area. Contents will adapt the layout to the viewing area to improve the horizontal space usage, while the layout of the whole page is not stable.
The level of the aside navigation is scalable. The first, second, and third level navigations could be present more fluently and relevantly, and aside navigation can be fixed, allowing the user to quickly switch and spot the current position, improving the user experience. However, this navigation occupies some horizontal space of the contents

expand code expand code

API

<Layout>
  <Header>header</Header>
  <Layout>
    <Sider>left sidebar</Sider>
    <Content>main content</Content>
    <Sider>right sidebar</Sider>
  </Layout>
  <Footer>footer</Footer>
</Layout>

Layout

The wrapper.

Property Description Type Default
class container className string -
style to customize the styles object|string -
hasSider whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering boolean -

APIs of Layout.Header Layout.Footer Layout.Content are the same as that of Layout.

Layout.Sider

The sidebar.

Property Description Type Default
breakpoint breakpoints of the responsive layout Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } -
class container className string -
collapsed(v-model) to set the current status boolean -
collapsedWidth width of the collapsed sidebar, by setting to 0 a special trigger will appear number 80
collapsible whether can be collapsed boolean false
defaultCollapsed to set the initial status boolean false
reverseArrow reverse direction of arrow, for a sider that expands from the right boolean false
style to customize the styles object|string -
theme color theme of the sidebar string: light dark dark
trigger specify the customized trigger, set to null to hide the trigger string|slot -
width width of the sidebar number|string 200

Events

Events Name Description Arguments
collapse the callback function, executed by clicking the trigger or activating the responsive layout (collapsed, type) => {}
breakpoint the callback function, executed when breakpoints changed (broken) => {}

breakpoint width

{
  xs: '480px',
  sm: '576px',
  md: '768px',
  lg: '992px',
  xl: '1200px',
  xxl: '1600px',
}