Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
The antd npm package is a UI design language and React UI library that provides a lot of out-of-the-box components and tools to help developers build user interfaces efficiently. It is widely used for enterprise-level applications and admin UIs due to its comprehensive set of components and professional look.
Layout
Provides a set of components to create a layout structure for your application, including headers, footers, sidebars, and content areas.
import { Layout } from 'antd';
const { Header, Footer, Sider, Content } = Layout;
ReactDOM.render(
<Layout>
<Header>Header</Header>
<Layout>
<Sider>Sider</Sider>
<Content>Content</Content>
</Layout>
<Footer>Footer</Footer>
</Layout>,
document.getElementById('container')
);
Data Display
Includes components like tables, lists, and cards to display data in a structured format.
import { Table } from 'antd';
const dataSource = [
{ key: '1', name: 'John Doe', age: 32, address: 'Some Street' },
{ key: '2', name: 'Jane Doe', age: 42, address: 'Another Street' }
];
const columns = [
{ title: 'Name', dataIndex: 'name', key: 'name' },
{ title: 'Age', dataIndex: 'age', key: 'age' },
{ title: 'Address', dataIndex: 'address', key: 'address' }
];
ReactDOM.render(<Table dataSource={dataSource} columns={columns} />, document.getElementById('container'));
Form Controls
Provides form components like input fields, checkboxes, radio buttons, and forms with validation.
import { Form, Input, Button } from 'antd';
const FormComponent = () => (
<Form>
<Form.Item label='Username' name='username'>
<Input />
</Form.Item>
<Form.Item label='Password' name='password'>
<Input.Password />
</Form.Item>
<Form.Item>
<Button type='primary' htmlType='submit'>Submit</Button>
</Form.Item>
</Form>
);
ReactDOM.render(<FormComponent />, document.getElementById('container'));
Feedback
Offers feedback components such as alerts, modals, notifications, and messages to interact with users.
import { message } from 'antd';
function success() {
message.success('This is a success message');
}
ReactDOM.render(<button onClick={success}>Show success message</button>, document.getElementById('container'));
Navigation
Includes navigation components like menus, tabs, breadcrumbs, and paginations to guide users through the application.
import { Menu } from 'antd';
const { SubMenu } = Menu;
ReactDOM.render(
<Menu mode='horizontal'>
<Menu.Item key='mail'>Navigation One</Menu.Item>
<SubMenu title='Navigation Two'>
<Menu.Item key='submenu-item-1'>Option 1</Menu.Item>
<Menu.Item key='submenu-item-2'>Option 2</Menu.Item>
</SubMenu>
</Menu>,
document.getElementById('container')
);
Also known as MUI, it is a popular React UI framework that follows Google's Material Design guidelines. It offers a different design philosophy compared to antd, which is more neutral and less opinionated, making it suitable for a wide range of projects.
It is a React component library that rebuilds the Bootstrap components with React. It provides a familiar Bootstrap-like interface for React applications, but it may not offer as many advanced components as antd does.
This is the official React integration for Semantic UI. It is similar to antd in providing a wide range of components, but it follows the design principles of Semantic UI, which focuses on human-friendly design.
Chakra UI is a simple, modular, and accessible component library that gives you the building blocks to build your React applications. It is known for its simplicity and ease of styling, which can be a contrast to antd's more out-of-the-box, styled components.
An enterprise-class UI design language and React-based implementation.
antd
is an open source project; improvements are welcomed. If you are interested in contributing to antd
, you can watch this repository, join in discussion, or try to implement some features which have been accepted. Actually, there are many ways to contribute. And we are always happy to offer collaborator permission for some active contributors.
npm install antd
import { DatePicker } from 'antd';
ReactDOM.render(<DatePicker />, mountNode);
And import style manually:
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
Manually import
import DatePicker from 'antd/lib/date-picker'; // for js
import 'antd/lib/date-picker/style/css'; // for css
// import 'antd/lib/date-picker/style'; // that will import less
// .babelrc or babel-loader option
{
"plugins": [
["import", { "libraryName": "antd", "style": "css" }] // `style: true` for less
]
}
Then you can import components from antd, equivalent to import manually below.
// import js and css modularly, parsed by babel-plugin-import
import { DatePicker } from 'antd';
// tsconfig.json
{
"compilerOptions": {
"moduleResolution": "node",
"jsx": "preserve",
"allowSyntheticDefaultImports": true
}
}
Note:
- set
allowSyntheticDefaultImports
to preventerror TS1192: Module 'react' has no default export
.- Don't use @types/antd, antd provide a built-in ts definition already.
{
loader: "ts-loader", // or awesome-typescript-loader
options {
getCustomTransformers: () => ({
before: [ tsImportPluginFactory({ libraryName: "antd", style: "css" }) ]
})
}
}
See i18n.
$ git clone git@github.com:ant-design/ant-design.git
$ npm install
$ npm start
Open your browser and visit http://127.0.0.1:8001 , see more at https://github.com/ant-design/ant-design/wiki/Development .
We welcome all contributions. Please read our CONTRIBUTING.md first. You can submit any ideas as pull requests or as GitHub issues. If you'd like to improve code, check out the Development Instructions and have a good time! :)
FAQs
An enterprise-class UI design language and React components implementation
The npm package antd receives a total of 936,284 weekly downloads. As such, antd popularity was classified as popular.
We found that antd demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.