Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bskimball/gatsby-plugin-antd
Plugin to add Ant Design to Gatsby
https://github.com/bskimball/gatsby-plugin-antd
Last synced: about 2 months ago
JSON representation
Plugin to add Ant Design to Gatsby
- Host: GitHub
- URL: https://github.com/bskimball/gatsby-plugin-antd
- Owner: bskimball
- License: unlicense
- Created: 2017-08-03T14:29:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T17:12:06.000Z (about 4 years ago)
- Last Synced: 2024-11-09T04:09:13.290Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 69
- Watchers: 3
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![npm package](https://img.shields.io/npm/v/gatsby-plugin-antd.svg?style=flat-square)](https://www.npmjs.org/package/gatsby-plugin-antd)
# gatsby-plugin-antd
Use Ant Design with Gatsby## Install
`npm install antd gatsby-plugin-antd --save`## How to use
1. Include the plugin in your `gatsby-config.js` file.```javascript
// in gatsby-config.js
plugins: [
'gatsby-plugin-antd'
]
// or if you want to use less
plugins: [
{
resolve: 'gatsby-plugin-antd',
options: {
style: true
}
}
]
```
note: if you are using less then you need to install less2. In your component(s) include the Ant Design component using dynamic imports as suggested here https://ant.design/docs/react/getting-started#Import-on-Demand
```javascript
// in your component
import { Button } from 'antd'export default () => Primary
```3. It will pull in the component and the relevant css file using babel-plugin-import