├── .gitignore
├── LICENSE
├── README.md
├── fab-dev
├── .gitignore
├── README.md
├── package-lock.json
├── package.json
├── public
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
├── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── FAB
│ │ ├── FloatingActionButton.jsx
│ │ ├── css
│ │ │ └── FAB.css
│ │ └── js
│ │ │ └── MaterialColors.js
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ └── serviceWorker.js
└── yarn.lock
├── img
└── FAB-Demo.gif
└── lib
├── .babelrc
├── package-lock.json
├── package.json
├── publish
├── FAB-Demo.gif
├── README.md
├── build
│ └── index.js
└── package.json
├── src
├── css
│ └── FAB.css
├── index.js
└── js
│ └── MaterialColors.js
└── webpack.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | # next.js build output
61 | .next
62 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React-Floating-Action-Button
2 | A dead simple React component that works similar to Android's Action Button
3 |
4 |
5 | 
6 |
7 | ___
8 |
9 | ### Getting Started
10 | 1. First, You need to install It, just like You would do with any NPM package:
11 | ```
12 | npm i --save react-floating-action-button
13 | ```
14 |
15 | 2. Then, You need to import the library components within your own component
16 | ``` javascript
17 | import React from 'react'
18 | import { Container, Button, Link } from 'react-floating-action-button'
19 | ```
20 |
21 | 3. You can now start using the FAB components!
22 | ``` javascript
23 | export default const YourAwesomeComponent = () => {
24 | return (
25 |
26 |
29 |
32 | className="fab-item btn btn-link btn-lg text-white"
33 |
39 | )
40 | }
41 | ```
42 |
43 |
44 | ### About Components
45 | - **Container** - It's simply a nav element that contains fab-container in its class list. You must involve your fab-items inside a Container, so the default styles are applied properly. Note that the last child will be recognized as the bigger button that is always visible and triggers the menu opening on hover.
46 | - **Button** - A special button element that has the class fab-item and an "i" element as its first child. You can add a click function callback by passing a "onClick" property, just like you would do with a regular button.
47 | - **Link** - Works exactly like the Button component, but instead of an "onClick", You need to pass a "href" prop to It.
48 |
49 | **NOTE**: All components support props.children rendering, which in combination with custom styles, will give You a lot of customization options.
50 |
51 | ### Extra Styling
52 | - **Container** - You can add custom classes using the "className" string property. You can also add custom styles by passing an object to the "styles" property, just like you would do with the regular style.
53 | - **Button and Link** - Both Support all mentioned for the Container, plus It gives You the option to add custom icon classes by passing an "icon" string property, as well as custom icon styles by passing an object property "iconStyles"
54 |
55 | ### Material Colors
56 | React-floating-action-button also exports two objects: lightColors and darkColors. These objects contain a few preset material colors that You can use when passing custom styles to the components, and help You to keep the overall design concise.
57 |
58 | **Usage**
59 | ``` javascript
60 | ...
61 | import { Container, Button, lightColors, darkColors } from 'react-floating-action-button'
62 | ...
63 |
64 |
68 |
69 |
70 | ```
71 | **Light Colors**
72 |
73 | | Color name | Hex value |
74 | | ------------- |:-------------:|
75 | | red | #ffcdd2 |
76 | | pink | #f8bbd0 |
77 | | purple | #e1bee7 |
78 | | lightBlue | #81d4fa |
79 | | cyan | #80deea |
80 | | teal | #80cbc4 |
81 | | blue | #bbdefb |
82 | | green | #dcedc8 |
83 | | yellow | #fff9c4 |
84 | | orange | #ffe0b2 |
85 | | brown | #d7ccc8 |
86 | | grey |#e0e0e0 |
87 | | darkerGrey | #bdbdbd |
88 | | black | #212121 |
89 | | white | #f5f5f5 |
90 |
91 | **Dark Colors**
92 |
93 | | Color name | Hex value |
94 | | ------------- |:-------------:|
95 | | lighterRed | #f44336 |
96 | | red | #c62828 |
97 | | pink | #ad1457 |
98 | | purple | #6a1b9a |
99 | | lightBlue | #01579b |
100 | | cyan | #00838f |
101 | | teal | #00695c |
102 | | blue | #0d47a1 |
103 | | green | #1b5e20 |
104 | | yellow | #f9a825 |
105 | | orange | #e65100 |
106 | | brown | #4e342e |
107 | | grey |#424242 |
108 | | black | #212121 |
109 | | white | #fafafa |
110 |
--------------------------------------------------------------------------------
/fab-dev/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/fab-dev/README.md:
--------------------------------------------------------------------------------
1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2 |
3 | ## Available Scripts
4 |
5 | In the project directory, you can run:
6 |
7 | ### `npm start`
8 |
9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11 |
12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console.
14 |
15 | ### `npm test`
16 |
17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19 |
20 | ### `npm run build`
21 |
22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance.
24 |
25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed!
27 |
28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29 |
30 | ### `npm run eject`
31 |
32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33 |
34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35 |
36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37 |
38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39 |
40 | ## Learn More
41 |
42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43 |
44 | To learn React, check out the [React documentation](https://reactjs.org/).
45 |
46 | ### Code Splitting
47 |
48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49 |
50 | ### Analyzing the Bundle Size
51 |
52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53 |
54 | ### Making a Progressive Web App
55 |
56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57 |
58 | ### Advanced Configuration
59 |
60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61 |
62 | ### Deployment
63 |
64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65 |
66 | ### `npm run build` fails to minify
67 |
68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
69 |
--------------------------------------------------------------------------------
/fab-dev/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fab-dev",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.8.3",
7 | "react-dom": "^16.8.3",
8 | "react-floating-action-button": "^1.0.3",
9 | "react-scripts": "2.1.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test",
15 | "eject": "react-scripts eject"
16 | },
17 | "eslintConfig": {
18 | "extends": "react-app"
19 | },
20 | "browserslist": [
21 | ">0.2%",
22 | "not dead",
23 | "not ie <= 11",
24 | "not op_mini all"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/fab-dev/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gustavo-Kuze/React-Floating-Action-Button/62ebe55c954fa23d74fca6a20986a2c92f3e3d6e/fab-dev/public/favicon.ico
--------------------------------------------------------------------------------
/fab-dev/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |