- Components Overview
- Changelogv6.1.4
- General
- Layout
- Navigation
- Data Entry
- Data Display
- Feedback
- Other
The first level navigation is left aligned near a logo, and the secondary menu is right aligned.
64px, and the second level navigation is 48px.80px, and the second level navigation is 56px.48+8n.200+8n.Style of a navigation should conform to its level.
Emphasis by colorblock
When the 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 the 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 navigation's, 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.
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.
<Layout><Header>header</Header><Layout><Sider>left sidebar</Sider><Content>main content</Content><Sider>right sidebar</Sider></Layout><Footer>footer</Footer></Layout>
Common props ref:Common props
The wrapper.
| Property | Description | Type | Default |
|---|---|---|---|
| className | Container className | string | - |
| hasSider | Whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering | boolean | - |
| style | To customize the styles | CSSProperties | - |
The sidebar.
| Property | Description | Type | Default |
|---|---|---|---|
| breakpoint | Breakpoints of the responsive layout | xs | sm | md | lg | xl | xxl | - |
| className | Container className | string | - |
| collapsed | 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 | CSSProperties | - |
| theme | Color theme of the sidebar | light | dark | dark |
| trigger | Specify the customized trigger, set to null to hide the trigger | ReactNode | - |
| width | Width of the sidebar | number | string | 200 |
| zeroWidthTriggerStyle | To customize the styles of the special trigger that appears when collapsedWidth is 0 | object | - |
| onBreakpoint | The callback function, executed when breakpoints changed | (broken) => {} | - |
| onCollapse | The callback function, executed by clicking the trigger or activating the responsive layout | (collapsed, type) => {} | - |
{xs:'480px',sm:'576px',md:'768px',lg:'992px',xl:'1200px',xxl:'1600px',}
| Token Name | Description | Type | Default Value |
|---|---|---|---|
| bodyBg | Background Color of body | string | #f5f5f5 |
| footerBg | Background Color of footer | string | #f5f5f5 |
| footerPadding | Padding of footer | Padding<string | number> | undefined | 24px 50px |
| headerBg | Background Color of header | string | #001529 |
| headerColor | Text color of header | string | rgba(0,0,0,0.88) |
| headerHeight | Height of header | string | number | 64 |
| headerPadding | Padding of header | Padding<string | number> | undefined | 0 50px |
| lightSiderBg | Background Color of light theme sider | string | #ffffff |
| lightTriggerBg | Background Color of light theme sider trigger | string | #ffffff |
| lightTriggerColor | Color of light theme sider trigger | string | rgba(0,0,0,0.88) |
| siderBg | Background Color of sider | string | #001529 |
| triggerBg | Background Color of sider trigger | string | #002140 |
| triggerColor | Color of sider trigger | string | #fff |
| triggerHeight | Height of sider trigger | string | number | 48 |
| zeroTriggerHeight | Height of sider trigger when collapse is 0 | number | 40 |
| zeroTriggerWidth | Width of sider trigger when collapse is 0 | number | 40 |
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.
Sticky Header is generally used to fix the top navigation to facilitate page switching.
When dealing with long content, a sticky sider can provide a better user experience.
Classic page layouts.
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 the viewing area.
Top-bottom structure is conformed 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.
Both the top navigation and the sidebar, commonly used in documentation site.
Both the top navigation and the sidebar, commonly used in application site.
If you want to use a customized trigger, you can hide the default one by setting trigger={null}.
Layout.Sider supports responsive layout.
Note: You can get a responsive layout by setting
breakpoint, the Sider will collapse to the width ofcollapsedWidthwhen window width is below thebreakpoint. And a special trigger will appear if thecollapsedWidthis set to 0.