We proudly present to you Glints Aries made by Front End Engineers of Glints. It is a Frontend framework to simplify and speed up your development. This project rebuilt with React and Styled Components. We are still actively develop this project day by day. So there are still a ton of amazing components to be built.
npm install -S glints-aries
Import the component into your file.
import { ... } from 'glints-aries'
Before you start implementing the component, it's always a good start to always wrap your root component with <GlintsContainer />
.
We created that Container to adapt with every screen sizes, so Users will always have best experience whenever they visit your site from their devices.
GlintsContainer also consists global style of glints-aries, so that it becomes a complement to the components.
For more details, you can read this at Utilities, then GlintsContainer section.
import { GlintsContainer } from 'glints-aries'
<GlintsContainer>
<Component />
</GlintsContainer>
yarn storybook
then open your browser on port 9001
- Open terminal in
glints-aries
. - Run
yarn link
. - Open terminal in your project.
- Run
yarn link glints-aries
. - Run
yarn build
inglints-aries
when finish changes and want to test locally in your project.
Run yarn unlink glints-aries
and re-install glints-aries
when you want to stop using local glints-aries
- Always do alphabetically when importing file.
- Put file on proper folder based on each respective uses.
- Use 2 Indent Spaces and Tab on the code.
- Follow this import structure for your code
- First: always import React library at first.
- Second: third-party.
- Third: glints-aries component.
- Fourth: glints-aries utilities.
- Fifth: styling.
import * as React from 'react'; // React
import classNames from 'classnames'; // Third-party
import PropTypes from 'prop-types'; // Third-party
import Modal from '../../Display/Modal'; // Glints Aries component
import { escEvent } from '../../Utils/DomUtils'; // Glints Aries utilities
import { Container, ModalBackground, ModalArea } from '../../Style/ModalStyle'; // Styling
Always give line break between different section when importing.
- Follow this code structure for your code
- First: Constructor / State
- Second: Local Function
- Third: React life cycle
- Forth: Render
- Always do line break whenever your import or variable is so long. You can do it like this but you can do it in another format as long as it can be legible and not long.
const {
type,
children,
className,
...defaultProps
} = this.props;
- Use Color library instead of writing hex color.
background-color: #EC272B; // Wrong
background-color: ${PrimaryColor.glintsred}; // Right
- Use Device Size instead of writing pixel size number.
@media (max-width: 600px) { ... } // Wrong
@media ${Device.mobileL} { ... } //Right
- For styling always use the component name followed by the role of that style.
CheckboxContainer
1. Checkbox is name of the component.
2. Container is outer part of the component.
JobcardImageWrapper
1. Jobcard is name of the component.
2. ImageWrapper is wrapper of the image inside Job Card.
- Don’t offer styling props on component.
<Collapsible onHoverColor="#FAFAFA" /> // Wrong
- Most of the time use em and rem, but still can use px for fixed dimension.
- Don't create to many element nodes inside the Component. Always do it in a simple way.
// Wrong
<div className="container">
<div className="wrapper">
<div>
<h1>This is Heading</h1>
</div>
</div>
</div>
- Use proper naming for interface, like isOpen or onClose.
- Always fix eslint before push your code.
A standalone piece of software that has a clear boundary that is accessible via an API and contains all of the application dependencies.
- Create consistent experience wherever they’re used through reusability.
- Component accelerates development.
- Identify company culture/ mission
- Base Color
- Type scale
- Border radius (rounding corner or sharp corner)
- Spacing scale (line-height)
- Letter spacing
- Shadow (how our shadow look like on every component)
Creating and maintaining a consistent UI and UX across every part of our product. It helps users intuitively navigate and successfully interact with different sections of your applications without confusion. It also creates sense of branding.
If you design a component, you should pay attention to
- Functional Consistency
- Visual Consistency
- Interface defines the component so component should respect the context. It means that Interface should be able to work in any possible context.
- Interface should have clear usability.
- Component should be flexible but still consistent.
- Only support functional interaction, not style.
- Great component supports accessibility.
- Always leave room for component to be flexible but still consistent.
- Component size should be flexible in every environment.
- Glints Aries’s interface should be able handle any possibilities.
- The name of the component must be easy to understand and clear based on the usage.
- Differentiate between component that should have children and self-closing tag.
- Improve accessibility.
- Always checking your code whether it's having clash with existing code.
- Do manual test.
- Remove all warnings and errors before push it to Github.
- Using ThemeProvider for distributing color.
- Doing Accessibility Testing in storybook.
- Doing Component Testing.
- Trying Knobs.
- Updating styled-component v4.