Frequently Asked Questions
Gestalt Usage
What are the benefits of using the Gestalt library?
- Styled, tested, and accessible components
- Right-to-left, internationalization, and dark-mode support
- Low maintaince (automatic design and code updates cross-platform)
- Well-documented components and continuous Gestalt team support
Component Usage
How can I visualize which components use Gestalt?
- Click the link in the bookmark bar.
- Red is bad: all places that are not using Gestalt will have a red border around them.
- Everything else is Gestalt (or using inline styles).
What is a boint?
padding 0 .. 12
How can add a new Icon?
dangerouslySetSvgPath
prop on Icon. If the asset is ready, we will happily add the Icon to Gestalt!How do I add Gestalt as a dependency?
How do I import components from Gestalt?
import { Button, Text } from 'gestalt';
What's required to support IE11?
// Load polyfills for IE 11
if (/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
document.write(
'<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>' +
'<script src="https://cdn.jsdelivr.net/gh/nuxodin/ie11CustomProperties@4.1.0/ie11CustomProperties.min.js"></script>'
);
}
Component Development
How do I get access to the Gestalt repo?
How do I easily generate files for a component?
yarn generate ComponentName
What do we use for integration tests and how do we run the tests locally?
yarn docs
yarn cypress run
What is Gestalt Teachings and how do I add a video?
Icons and SVGs
If you need a new icon for an experiment that is not listed on our Icon documentation, use the dangerouslySetSvgPath
prop on Icon, IconButton, and Pog. However, dangerouslySetSvgPath
only works with one SVG path. For icons with multiple paths and groups, use Box and dangerouslySetInlineStyle
to pass the custom icon as backgroundImage
.
Once your experiment ships to 100%, ask your designer to follow the directions in the Icon kit. Once the asset is ready, we can add the Icon to Gestalt.
We recommend streamlining (removing strokes, transforms, ...) and optimizing the SVGs to improve the performance and the pinner experience using the tools svgo or ImageOptim
Gestalt Icon svg files follow a particular format and use automatic file validation testing.
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"> <path d="_______________"/> </svg>
We override the color in the Gestalt Icon component and Gestalt only uses the d
attribute in the path
tag and the basic attributes for visualizing the raw file in the svg
tag . For consistency, we don't include unnecessary attributes in the svg
and path
tags.
Accessibility notes:
- Icons must meet the Non-Text Contrast requirement.
- Avoid using unfamiliar icons. Always refer to Gestalt available icons. A new icon needs to be user tested to evaluate comprehension.
- Some icons don’t translate well in all cultures, so it's preferred to user-test each Icon before it gets added to Gestalt.
Automated Releases
How does versioning work in Gestalt?
My Pull Request fails on "Semver / Require Label (pull_request)", how do I fix it?
How do these automated releases work under the hood?
- Fetch semver label for the associated PR (patch / minor / major)
- Check out the repository
- Setup Node.js
- Bump package.json version
- Update CHANGELOG.md file
- Create GitHub release
- Publish to npm
- Update Gestalt Documentation