All Projects → ant-design → Ant Design Pro Layout

ant-design / Ant Design Pro Layout

Licence: mit
🌃 Powerful and easy to use beautiful layout

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ant Design Pro Layout

Smart Admin
SmartAdmin 使用 SpringBoot和Vue,前后端分离,我们希望用一套漂亮的代码和一套整洁的代码规范,让大家在这浮躁的代码世界里感受到一股把代码写好的清流!同时又让开发者节省大量的时间,减少加班,快乐工作,热爱生活。SmartAdmin 让你从认识到忘不了,绝对是你最想要的!
Stars: ✭ 930 (-3.83%)
Mutual labels:  admin, ant-design
ToBeAdmin
beego 与 Ant Design Pro Vue 基础权限系统
Stars: ✭ 38 (-96.07%)
Mutual labels:  admin, ant-design
Vue Antd Admin
🐜 Ant Design Pro's implementation with Vue
Stars: ✭ 2,766 (+186.04%)
Mutual labels:  admin, ant-design
Pearproject
pear,梨子,轻量级的在线项目/任务协作系统,远程办公协作
Stars: ✭ 1,610 (+66.49%)
Mutual labels:  admin, ant-design
generator-antd-pro
An easy way to build your ant-design-pro application.
Stars: ✭ 34 (-96.48%)
Mutual labels:  admin, ant-design
React Admin
🎉 A magical react admin
Stars: ✭ 149 (-84.59%)
Mutual labels:  admin, ant-design
Vue Admin
基于and-design-vue的vue后台管理系统模板
Stars: ✭ 226 (-76.63%)
Mutual labels:  admin, ant-design
Ant Design Pro Plus
✨ 基于 ant-design-pro 做一些微小的工作。
Stars: ✭ 88 (-90.9%)
Mutual labels:  admin, ant-design
vue-iview-admin-template
Vue 2.0 admin template based on View UI
Stars: ✭ 43 (-95.55%)
Mutual labels:  admin, ant-design
ng-antd-admin
A angular style Admin based on angular, ng-zorro-antd,Efforts to update in progress...
Stars: ✭ 53 (-94.52%)
Mutual labels:  admin, ant-design
Dva Boot Admin
🍰 react admin dashboard ui LANIF-ADMIN --- react 16 + react-router 4 + dva 2 + antd 4 后台管理 脚手架
Stars: ✭ 1,553 (+60.6%)
Mutual labels:  admin, ant-design
React Antd
基于react + redux + immutable + less + ES6/7 + webpack2.0 + fetch + react-router + antd实现的SPA后台管理系统模板
Stars: ✭ 321 (-66.8%)
Mutual labels:  admin, ant-design
React Antd Admin
用React和Ant Design搭建的一个通用管理后台
Stars: ✭ 1,313 (+35.78%)
Mutual labels:  admin, ant-design
Ant Design Pro
👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
Stars: ✭ 30,909 (+3096.38%)
Mutual labels:  admin, ant-design
Ant Back
🚀 react后台,后台管理系统
Stars: ✭ 90 (-90.69%)
Mutual labels:  admin, ant-design
React Ant Admin
使用 ant-design react react-hook ts 开发的类 ant-design-pro 管理后台,具有完整的权限系统和配套的node + ts 的 api
Stars: ✭ 199 (-79.42%)
Mutual labels:  admin, ant-design
Vue Admin Beautiful
🚀🚀🚀vue3 admin,vue3.0 admin,vue后台管理,vue-admin,vue3.0-admin,admin,vue-admin,vue-element-admin,ant-design,vue-admin-beautiful-pro,vab admin pro,vab admin plus主线版本基于element-plus、element-ui、ant-design-vue三者并行开发维护,同时支持电脑,手机,平板,切换分支查看不同的vue版本,element-plus版本已发布(vue3,vue3.0,vue,vue3.x,vue.js)
Stars: ✭ 10,968 (+1034.23%)
Mutual labels:  admin, ant-design
React Antd Multi Tabs Admin
ts+react+antd-多页签后台模板(纯净版,非 antd pro!)
Stars: ✭ 73 (-92.45%)
Mutual labels:  admin, ant-design
vue-admin-better
🚀🚀🚀vue admin,vue3 admin,vue3.0 admin,vue后台管理,vue-admin,vue3.0-admin,admin,vue-admin,vue-element-admin,ant-design,vue-admin-beautiful-pro,vab admin pro,vab admin plus,vue admin plus,vue admin pro
Stars: ✭ 12,962 (+1240.43%)
Mutual labels:  admin, ant-design
Ant Design Pro Blazor
👨🏻‍💻👩🏻‍💻 An out-of-box UI solution for enterprise applications as a Blazor boilerplate.
Stars: ✭ 277 (-71.35%)
Mutual labels:  admin, ant-design

此仓库已废弃

重要: 此仓库后续不再维护,也不再接受更多的特性更新。ant-design/pro-layout 将会迁移至 ant-design/pro-components 仓库进行后续的维护,访问 https://procomponent.ant.design/layout 了解更多。此变更不影响继续使用 @ant-design/pro-layout 这个 npm 包名安装使用此组件。

English | 简体中文 changelog

npm package

Ant Design Pro Layout

image

An out-of-box UI solution for enterprise applications as a React boilerplate. This repository is the layout of Ant Design Pro and was developed for quick and easy use of the layout.

Usage

npm i @ant-design/pro-layout --save
// or
yarn add @ant-design/pro-layout
import ProLayout from '@ant-design/pro-layout';

render(<ProLayout />, document.getElementById('root'));

Demo

site

API

ProLayout

All methods with the suffix Render can prevent rendering by passing in false.

Property Description Type Default Value
title layout in the upper left corner title ReactNode 'Ant Design Pro'
logo layout top left logo url ReactNode | ()=>ReactNode -
pure Interface that doesn't require extra ui boolean -
loading layout loading status boolean -
menuHeaderRender render logo and title ReactNode | (logo,title)=>ReactNode -
onMenuHeaderClick menu header click event (e: React.MouseEvent<HTMLDivElement>) => void -
contentStyle layout content style CSSProperties -
layout layout menu mode, side: right navigation, top: top navigation 'side' | 'top' 'side'
contentWidth content mode of layout, Fluid: fixed width 1200px, Fixed: adaptive 'Fluid' | 'Fixed' 'Fluid'
navTheme Navigation menu theme 'light' | 'dark' 'dark'
fixedHeader whether to fix header to top boolean false
fixSiderbar Whether to fix navigation menu boolean false
breakpoint breakpoints of the responsive layout Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } lg
menu About the configuration of the menu, only locale, locale can turn off the globalization of the menu { locale: boolean,defaultOpenAll: boolean } { locale: true }
iconfontUrl Use IconFont icon configuration string -
locale The language setting of the layout 'zh-CN' | 'zh-TW' | 'en-US' navigator.language
settings layout settings Settings Settings
siderWidth width of sider menu number 256
collapsed control menu's collapse and expansion boolean true
onPageChange Triggered when page switching (location: Location) => void -
onCollapse folding collapse event of menu (collapsed: boolean) => void -
headerRender custom header render method (props: BasicLayoutProps) => ReactNode -
headerTitleRender custom header title render method (props: BasicLayoutProps) => ReactNode -
headerContentRender custom header content render method (props: BasicLayoutProps) => ReactNode -
rightContentRender header right content render method (props: HeaderViewProps) => ReactNode -
collapsedButtonRender custom collapsed button method (collapsed: boolean) => ReactNode -
footerRender custom footer render method (props: BasicLayoutProps) => ReactNode -
pageTitleRender custom page title render method (props: BasicLayoutProps) => ReactNode -
menuRender custom menu render method (props: HeaderViewProps) => ReactNode -
menuDataRender The render method of menuData, with the definition of menuData (menuData: MenuDataItem[]) => MenuDataItem[] -
postMenuData View the menu data before displaying it. Modification will not trigger re-rendering. (menuData: MenuDataItem[]) => MenuDataItem[] -
postMenuData
menuItemRender the render method of a custom menu item (itemProps: MenuDataItem) => ReactNode -
subMenuItemRender the render method of a custom subMenu item (itemProps: MenuDataItem) => ReactNode -
breadcrumbRender custom breadcrumbs data (route)=>route -
route Used to assist in the generation of menu and bread crumbs. Umi will automatically bring route -
disableMobile Disable automatic switch to mobile mode boolean false
links Shortcuts displayed in the lower right corner of the menu ReactNode[] -
menuProps Props passed to ANTD MENU, SEE (https://ant.design/components/menu-cn/) MenuProps undefined

Layout support for most of Menu by menuProps after 4.5.13.

SettingDrawer

import { SettingDrawer } from '@ant-design/pro-layout';

SettingDrawer provides a graphical interface to set the layout configuration. Not recommended for use in a product environment.

Property Description Type Default Value
settings layout settings Settings Settings
onSettingChange The setting changes event (settings: Settings) => void -
hideHintAlert remove hint info boolean -

PageContainer

PageContainer encapsulates the PageHeader component of ant design, adds tabList, and content. Fill in the title and breadcrumb based on the current route. It depends on the route property of the Layout. Of course you can pass in parameters to override the default values. PageContainer supports all the attributes of Tabs and PageHeader.

Property Description Type Default Value
content Content area ReactNode -
extraContent Extra content area, on the right side of content ReactNode -
tabList Tabs title list Array<{key: string, tab: ReactNode}> -
tabActiveKey The currently highlighted tab item string -
onTabChange Switch panel callback (key) => void -
tabBarExtraContent Extra elements on the tab bar React.ReactNode -

PageLoading

a simple loading page

Property Description Type Default Value
tip loading tip ReactNode -

RouteContext

RouteContext can provide built-in data for Layout. For example, isMobile and collapsed, you can consume this data to customize some behavior.

import { RouteContext, RouteContextType } from '../index';

const Page = () => (
  <RouteContext.Consumer>
    {(value: RouteContextType) => {
      return value.title;
    }}
  </RouteContext.Consumer>
);

GridContent

GridContent encapsulates equal width and streaming The logic of analysis?layout=top). You can see the preview in preview.

Property Description Type Default Value
contentWidth Content mode 'Fluid' | 'Fixed' -

getMenuData

Generate menuData and breadcrumb based on the router information.

import { getMenuData } from '@ant-design/pro-layout';

const { breadcrumb, menuData } = getMenuData(
  routes,
  menu,
  formatMessage,
  menuDataRender,
);
Property Description Type Default Value
routes Routing configuration information route[] -
menu Menu configuration item, default {locale: true} { locale: boolean } -
menuDataRender The render method of menuData, with the definition of menuData (menuData: MenuDataItem[]) => MenuDataItem[] -
formatMessage The formatMessage method of react-intl (data: { id: any; defaultMessage?: string }) => string; -

getPageTitle

import { getPageTitle } from '@ant-design/pro-layout';

const title = getPageTitle({
  pathname,
  breadcrumb,
  menu,
  title,
  formatMessage,
});

getPageTitle encapsulates the logic based on the title generated on menuData.

Property Description Type Default Value
pathname Current pathname location.pathname -
breadcrumb Collection of MenuDataItem { [path: string]: MenuDataItem } -
menu Menu configuration item, default {locale: true} { locale: boolean } -
title Type of title string 'Ant Design Pro'
formatMessage The formatMessage method of react-intl (data: { id: any; defaultMessage?: string }) => string; -

Data Structure

For ease of viewing and use, Typescript is used here to write.

Settings

// can be done via import { Settings } from '@ant-design/pro-layout/defaultSettings' to get this type

export interface Settings {
  /**
   * theme for nav menu
   */
  navTheme: 'light' | 'dark';
  /**
   * primary color of ant design
   */
  primaryColor: string;
  /**
   * nav menu position: `side` or `top`
   */
  layout: 'side' | 'top';
  /**
   * layout of content: `Fluid` or `Fixed`, only works when layout is top
   */
  contentWidth: 'Fluid' | 'Fixed';
  /**
   * sticky header
   */
  fixedHeader: boolean;
  /**
   * sticky siderbar
   */
  fixSiderbar: boolean;
  menu: { locale: boolean };
  title: string;
  pwa: boolean;
  // Your custom iconfont Symbol script Url
  // eg://at.alicdn.com/t/font_1039637_btcrd5co4w.js
  // Usage: https://github.com/ant-design/ant-design-pro/pull/3517
  iconfontUrl: string;
  colorWeak: boolean;
}

MenuDataItem

// can be imported { MenuDataItem } from '@ant-design/pro-layout/typings' to get this type

export interface MenuDataItem {
  authority?: string[] | string;
  children?: MenuDataItem[];
  hideChildrenInMenu?: boolean;
  hideInMenu?: boolean;
  icon?: string;
  locale?: string;
  name?: string;
  path: string;
  [key: string]: any;
}

Route

// can be imported { RouterTypes } from '@ant-design/pro-layout/typings'  to get this type
export interface Route {
  path: string;
  routes: Array<{
    exact?: boolean;
    icon: string;
    name: string;
    path: string;
    // optional secondary menu
    children?: Route['routes'];
  }>;
}

Contributing

Any type of contribution is welcome, here are some examples of how you may contribute to this project:

  • Use Ant Design Pro in your daily work.
  • Submit issues to report bugs or ask questions.
  • Propose pull requests to improve our code.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].