|
| 1 | +# rc-footer 🐾 |
| 2 | + |
| 3 | +[![NPM version][npm-image]][npm-url] |
| 4 | +[![build status][travis-image]][travis-url] |
| 5 | +[![Codecov][codecov-image]][codecov-url] |
| 6 | +[![david deps][david-image]][david-url] |
| 7 | +[![david devDeps][david-dev-image]][david-dev-url] |
| 8 | +[![npm download][download-image]][download-url] |
| 9 | + |
| 10 | +[npm-image]: http://img.shields.io/npm/v/rc-footer.svg?style=flat-square |
| 11 | +[npm-url]: http://npmjs.org/package/rc-footer |
| 12 | +[travis-image]: https://img.shields.io/travis/com/react-component/footer.svg?style=flat-square |
| 13 | +[travis-url]: https://travis-ci.com/react-component/footer |
| 14 | +[codecov-image]: https://img.shields.io/codecov/c/github/react-component/footer/master.svg?style=flat-square |
| 15 | +[codecov-url]: https://codecov.io/gh/react-component/footer/branch/master |
| 16 | +[david-image]: https://david-dm.org/react-component/footer/status.svg?style=flat-square |
| 17 | +[david-dev-url]: https://david-dm.org/react-component/footer?type=dev |
| 18 | +[david-dev-image]: https://david-dm.org/react-component/footer/dev-status.svg?style=flat-square |
| 19 | +[david-url]: https://david-dm.org/react-component/footer |
| 20 | +[download-image]: https://img.shields.io/npm/dm/rc-footer.svg?style=flat-square |
| 21 | +[download-url]: https://npmjs.org/package/rc-footer |
| 22 | + |
| 23 | +Pretty Footer react component used in [ant.design](https://ant.design). |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +## Live Demo |
| 28 | + |
| 29 | +https://react-component.github.io/footer/ |
| 30 | + |
| 31 | +## Install |
| 32 | + |
| 33 | +[](https://npmjs.org/package/rc-footer) |
| 34 | + |
| 35 | +## Usage |
| 36 | + |
| 37 | +```js |
| 38 | +import Footer from 'rc-footer'; |
| 39 | +import 'rc-footer/assets/index.css'; // import 'rc-footer/asssets/index.less'; |
| 40 | +import { render } from 'react-dom'; |
| 41 | + |
| 42 | +render( |
| 43 | + <Footer |
| 44 | + columns={[ |
| 45 | + { |
| 46 | + icon: ( |
| 47 | + <img src="https://gw.alipayobjects.com/zos/rmsportal/XuVpGqBFxXplzvLjJBZB.svg" /> |
| 48 | + ), |
| 49 | + title: '语雀', |
| 50 | + url: 'https://yuque.com', |
| 51 | + description: '知识创作与分享工具', |
| 52 | + openExternal: true, |
| 53 | + }, |
| 54 | + ]} |
| 55 | + bottom="Made with ❤️ by AFX" |
| 56 | + />, |
| 57 | + mountNode, |
| 58 | +); |
| 59 | +``` |
| 60 | + |
| 61 | +## API |
| 62 | + |
| 63 | +| Property | Type | Default | Description | |
| 64 | +| ---------------- | --------------------------------- | -------------- | ---------------------------------------- | |
| 65 | +| prefixCls | string | rc-footer | | |
| 66 | +| className | string | '' | additional class name of footer | |
| 67 | +| style | React.CSSProperties | | style properties of footer | |
| 68 | +| columns | [Column](#Column) Array | [] | columns data inside footer | |
| 69 | +| bottom | ReactNode | | extra bottom area beneath footer columns | |
| 70 | +| theme | 'light' \| 'dark' | 'dark' | preset theme of footer | |
| 71 | +| backgroundColor | string | '#000' | background color of footer | |
| 72 | +| columnLayout | 'space-around' or 'space-between' | 'space-around' | justify-content value of columns element | |
| 73 | +| maxColumnsPerRow | number | - | max count of columns for each row | |
| 74 | + |
| 75 | +### Column |
| 76 | + |
| 77 | +| Property | Type | Default | Description | |
| 78 | +| --------- | -------------------------- | ------- | ------------------------------- | |
| 79 | +| icon | ReactNode | | icon that before column title | |
| 80 | +| title | ReactNode | | title of column | |
| 81 | +| items | [Item](#Column-Item) Array | [] | items data inside each column | |
| 82 | +| className | string | '' | additional class name of footer | |
| 83 | +| style | React.CSSProperties | | style properties of footer | |
| 84 | + |
| 85 | +### Column Item |
| 86 | + |
| 87 | +| Property | Type | Default | Description | |
| 88 | +| ------------- | ------------------- | ------- | ------------------------------------------------------- | |
| 89 | +| icon | ReactNode | | icon that before column title | |
| 90 | +| title | ReactNode | | title of column | |
| 91 | +| description | ReactNode | | description of column, come after title | |
| 92 | +| url | string | | link url of item title | |
| 93 | +| openExternal | boolean | false | link target would be `_blank` if `openExternal` is ture | |
| 94 | +| className | string | '' | additional class name of footer | |
| 95 | +| style | React.CSSProperties | | style properties of footer | |
| 96 | +| LinkComponent | React.ReactType | 'a' | the link element to render item | |
| 97 | + |
| 98 | +## Development |
| 99 | + |
| 100 | +``` |
| 101 | +npm install |
| 102 | +npm start |
| 103 | +``` |
| 104 | + |
| 105 | +## License |
| 106 | + |
| 107 | +rc-footer is released under the MIT license. |
0 commit comments