logo

Layout

Handling the overall layout of a page.

Specification

Size

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

  • Top Navigation: the height of the first level navigation 64px, the second level navigation 48px.
  • Top Navigation (for landing pages): 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

    12px, 14px 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.

If you need to add in-app tabs, use it with the ReuseTabs component.

Examples

Classic page layouts.

expand code expand code

The most basic "header-content-footer" layout.

Generally, the mainnav is placed at the top of the page, and includes the logo, the first level navigation, and the secondary menu (users, settings, notifications) from left to right in it. We always put contents in a fixed size navigation (eg: 1200px), the layout of the whole page is stable, it's not affected by viewing area.

Top-bottom structure is conform with the top-bottom viewing habit, it's a classical navigation pattern of websites. This pattern demonstrates efficiency in the main workarea, while using some vertical space. And because the horizontal space of the navigation is limited, this pattern is not suitable for cases when the first level navigation contains many elements or links

expand code expand code

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

expand code expand code

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

expand code expand code

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

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

expand code expand code

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 Header is generally used to fix the top navigation to facilitate page switching.

expand code expand code

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

expand code expand code

Layout API#

Property Description Type Default Value
ChildContent ParameterThe inner content RenderFragment --
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --

Header API#

Property Description Type Default Value
ChildContent ParameterThe inner content RenderFragment --
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --
Property Description Type Default Value
ChildContent ParameterThe inner content RenderFragment --
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --

Content API#

Property Description Type Default Value
ChildContent ParameterThe inner content RenderFragment --
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --

Sider API#

Property Description Type Default Value
Collapsible ParameterIf sider is collapsible or not Boolean --
ChildContent ParameterContent of the sider RenderFragment --
Trigger ParameterCollapse/expand UI element to allow manually changing. RenderFragment --
NoTrigger ParameterRemove UI trigger for collapse/expanding manually Boolean --
Breakpoint ParameterBreakpoint at which sider will collapse by default BreakpointType? --
Theme ParameterColor theme SiderTheme SiderTheme.Dark
Width ParameterWidth of sider when expanded, in pixels Int32 200
CollapsedWidth ParameterWidth of sider when collapsed, in pixels Int32 80
Collapsed ParameterIf sider is collapsed or not Boolean --
CollapsedChanged ParameterCallback executed when sider is changes from open to collapsed, regardless of what caused it EventCallback<Boolean> --
OnCollapse ParameterCallback executed when sider is changes from open to collapsed, regardless of what caused itUse CollapsedChanged instead

Obsolete Will be removed in a future version.
EventCallback<Boolean> --
OnBreakpoint ParameterCallback executed when window size changes the breakpoint EventCallback<Boolean> --
DefaultCollapsed ParameterTo set the initial status Boolean false
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --
Grid Space
文档已更新,请点击 此处 更新。
A new version of this app is available. Click here to update.