logoAnt Design

⌘ K
  • 디자인
  • 개발
  • 컴포넌트
  • 블로그
  • 자료
5.21.3
  • Components Overview
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
      5.5.0
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
    • Popover
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • Tour
      5.0.0
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
      5.1.0
  • Other
    • Affix
    • App
      5.1.0
    • ConfigProvider
    • Util
      5.13.0

Layout

Handling the overall layout of a page.
가져오기import{ Layout }from"antd";
소스components/layout
문서
이 페이지 수정변경 로그

Resources

Ant Design Charts
Ant Design Pro
Ant Design Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
ahooks-React Hooks Library
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference
Work with Us

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

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

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

API

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

Layout

Common props ref:Common props

The wrapper.

PropertyDescriptionTypeDefault
classNameContainer classNamestring-
hasSiderWhether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickeringboolean-
styleTo customize the stylesCSSProperties-

Layout.Sider

The sidebar.

PropertyDescriptionTypeDefault
breakpointBreakpoints of the responsive layoutxs | sm | md | lg | xl | xxl-
classNameContainer classNamestring-
collapsedTo set the current statusboolean-
collapsedWidthWidth of the collapsed sidebar, by setting to 0 a special trigger will appearnumber80
collapsibleWhether can be collapsedbooleanfalse
defaultCollapsedTo set the initial statusbooleanfalse
reverseArrowReverse direction of arrow, for a sider that expands from the rightbooleanfalse
styleTo customize the stylesCSSProperties-
themeColor theme of the sidebarlight | darkdark
triggerSpecify the customized trigger, set to null to hide the triggerReactNode-
widthWidth of the sidebarnumber | string200
zeroWidthTriggerStyleTo customize the styles of the special trigger that appears when collapsedWidth is 0object-
onBreakpointThe callback function, executed when breakpoints changed(broken) => {}-
onCollapseThe callback function, executed by clicking the trigger or activating the responsive layout(collapsed, type) => {}-

breakpoint width

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

Design Token

컴포넌트 토큰어떻게 사용하나요?

토큰 이름설명타입기본값
bodyBg主体部分背景色string#f5f5f5
footerBg页脚背景色string#f5f5f5
footerPadding页脚内边距undefined | Padding<string | number>24px 50px
headerBg顶部背景色string#001529
headerColor顶部文字颜色stringrgba(0, 0, 0, 0.88)
headerHeight顶部高度string | number64
headerPadding顶部内边距undefined | Padding<string | number>0 50px
lightSiderBg亮色主题侧边栏背景色string#ffffff
lightTriggerBg亮色主题侧边栏开关背景色string#ffffff
lightTriggerColor亮色主题侧边栏开关颜色stringrgba(0, 0, 0, 0.88)
siderBg侧边栏背景色string#001529
triggerBg侧边栏开关背景色string#002140
triggerColor侧边栏开关颜色string#fff
triggerHeight侧边栏开关高度string | number48
zeroTriggerHeightcollapse 为 0 时侧边栏开关高度number40
zeroTriggerWidthcollapse 为 0 时侧边栏开关宽度number40

글로벌 토큰어떻게 사용하나요?

Sider
codepen icon
External Link Icon
expand codeexpand code
Fixed Header
codepen icon
External Link Icon
expand codeexpand code
Fixed Sider
codepen icon
External Link Icon
expand codeexpand code
Basic Structure
codepen icon
External Link Icon
expand codeexpand code
Header-Content-Footer
codepen icon
External Link Icon
expand codeexpand code
Header-Sider
codepen icon
External Link Icon
expand codeexpand code
Header Sider 2
codepen icon
External Link Icon
expand codeexpand code
Custom trigger
codepen icon
External Link Icon
expand codeexpand code
Responsive
codepen icon
External Link Icon
expand codeexpand code
Custom trigger debug
codepen icon
External Link Icon
expand codeexpand code
Component Token
codepen icon
External Link Icon
expand codeexpand code
Header
Content
Footer
Header
Sider
Content
Footer
Header
Content
Sider
Footer
Sider
Header
Content
Footer
  • nav 1
  • nav 2
  • nav 3
  • nav 4
  • nav 5
  • nav 6
  • nav 7
  • nav 8
  • nav 9
  • nav 10
  • nav 11
  • nav 12
  • nav 13
  • nav 14
  • nav 15
  1. Home
  2. /
  3. List
  4. /
  5. App
Content
Ant Design ©2024 Created by Ant UED
  • nav 1
  • nav 2
  • nav 3
  1. Home
  2. /
  3. List
  4. /
  5. App
  • subnav 1
    • option1
    • option2
    • option3
    • option4
  • subnav 2
  • subnav 3
Content
Ant Design ©2024 Created by Ant UED
  • nav 1
  • nav 2
  • nav 3
  • subnav 1
    • option1
    • option2
    • option3
    • option4
  • subnav 2
  • subnav 3
  1. Home
  2. /
  3. List
  4. /
  5. App
Content
  • nav 1
  • nav 2
  • nav 3
Content
  • nav 1
  • nav 2
  • nav 3
  • nav 4
content
Ant Design ©2024 Created by Ant UED
  • Option 1
  • Option 2
  • User
  • Team
Content
Ant Design
  • subnav 1
    • option1
    • option2
    • option3
    • option4
  • subnav 2
  • subnav 3
  1. Home
  2. /
  3. List
  4. /
  5. App
Content