Skip to content

Commit

Permalink
docs(icon): Add description for Decorative and Standalone icon compon…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
lzcabrera committed Sep 25, 2017
1 parent 895d3c8 commit c450d22
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/Icons/DecorativeIcon/DecorativeIcon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import PropTypes from 'prop-types'

import Icon from '../Icon/Icon'

/**
* An icon that is used just for visual aesthetics.
*
* <span class="docs--badge green">wip</span>
*/
const DecorativeIcon = ({ symbol, variant, size, ...rest }) => (
<Icon {...rest} symbol={symbol} variant={variant} size={size} aria-hidden="true" />
)
Expand Down
23 changes: 23 additions & 0 deletions src/components/Icons/DecorativeIcon/DecorativeIcon.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,26 @@
<DecorativeIcon symbol="times" />
</div>
```

### Modifying color

Use the `variant` prop to alter the icon's color. Each variant has semantic meaning.

```
<div className="docs--horizontal-spacing">
<DecorativeIcon symbol="checkmark" variant="primary" />
<DecorativeIcon symbol="incomplete" variant="secondary" />
<DecorativeIcon symbol="exclamationPointCircle" variant="error" />
</div>
```

### Adjusting size

Use the `size` prop to adjust the icon's size.

```
<div className="docs--horizontal-spacing">
<DecorativeIcon symbol="chevron" variant="primary" size={16} />
<DecorativeIcon symbol="exclamationPointCircle" variant="error" size={24} />
</div>
```
6 changes: 6 additions & 0 deletions src/components/Icons/StandaloneIcon/StandaloneIcon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import PropTypes from 'prop-types'

import Icon from '../Icon/Icon'

/**
* An icon that has meaning within the context of the page,
* which should be communicated to screen readers.
*
* <span class="docs--badge green">wip</span>
*/
const StandaloneIcon = ({ symbol, variant, size, a11yText, ...rest }) => (
<Icon {...rest} symbol={symbol} variant={variant} size={size} aria-label={a11yText} />
)
Expand Down

0 comments on commit c450d22

Please sign in to comment.