question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

💡 Proposal - new ProductIcon / NavigationIcon component in Forma36

See original GitHub issue

Forma 36 ProductIcon / NavigationIcon

The problem

Hey there 👋

I would like to propose to extend Forma36 to contain the <ProductIcon /> / <NavigationIcon /> component. This component is used by navigation and headlines of the pages in the webapp. By moving this icons into Forma36 we would improve the visibility of the product related icons, potentially it might be useful for customers that are creating their custom solutions. This would also give us a chance to present our guidelines and recommendations for icons, for developers and designers. In the future, if we consider moving navigation elements into Forma36, this step could be also beneficial. We would have all icons aligned, visible and be part of the design system, which would give us more consistency and transparency.

The proposed solution

Proposed component was already created in the Contentful web app. It is used by top navigation items and headlines of the pages:

Screenshot 2020-05-05 at 09 39 30 Screenshot 2020-05-05 at 09 39 46
  1. New <NavigationIcon /> in the web app has predefined set of sizes:
  small: '18px',
  medium: '24px',
  large: '32px',
  xlarge: '48px'

I would like to propose to align sizes of Forma36 <Icon /> and <NavigationIcon /> component in terms of sizes, to keep them consistent. We would end up with following set for both components:

  tiny: '16px',
  small: '18px',
  medium: '24px',
  large: '32px',
  xlarge: '48px'
  1. Currently <NavigationIcon /> in the Contentful web app takes only 2 colors: colorGreenBase and colorWhite, but we could extend it if needed. Maybe align <Icon /> and <NavigationIcon /> when it comes to colors?

  2. I would like to also propose to have an option to define tag type to be 'div' | 'span' within this new component.

  3. We could allow this component to display custom SVG just in case it’s needed, something like (pseudo code):

{type ? <IconComponent /> : children}
  1. Apart of the above, we would also allow testId and className of course.

  2. Alignment of the documentation for existing <Icon /> and creating docs for new component: I think we could extend our existing documentation to contain more examples of usage. Currently we don’t really have much examples and I think it might be useful. We could present how to use icons with text in different sizes - how we propose to align text with icons, what is our recommendation. Also we could show how to use icons in other components, like <Button />. Same approach would apply for new component docs - we could create documentation in the way that it present some use cases.

  3. Component was already created in the Contentful web app, so some part of work is already done. We would need to create/re-create component in Forma36 based on the existing one from web app, create storybook (maybe also adjust or extend the storybook for existing <Icon /> component) and create documentation and adjust the existing one. At the end, we would need to replace component in the web app, of course.

Questions

  1. Alignment of the sizes require to align existing Icon--large (which is 36px) with the `large: ‘32px’ from the new component. Do you think that would be ok to align them (both 32px) or we would prefer to merge them?
  2. Should we align both components in terms of colors right now?
  3. Name of the new component: currently it exists as <NavigationIcon /> in the web app but we can change it into something more generic like <ProductIcon /> or anything else that comes to your mind. WDYT?
  4. Should we allow custom SVG’s to be passed into the component?

And that’s it 🎉

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gui-santoscommented, May 7, 2020

Good job! 👏 👏 👏

I think this is a good solution for the case of having two sets of Icons. IMO having only one component would be better but in this case, I feel that this proposal would help us to keep both sets under control

I agree with aligning the props of both components, but I would check if we have cases of the <Icon /> as large (if you checked already ignore this hahaha)

Regarding the name. I think NavigationIcon has the advantage that we are committing with using this set only for the navigation cases which IMO is good. I also think we would need to create some good documentation explaining where to use what btw

I don’t think we should allow custom SVGs. If we need more Icons we can always update the set

0reactions
burakukulacommented, Jul 3, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

💡 Proposal - components documentation in README · Issue #659 ...
Hey! For the overview purposes I will add the list of the components that needs README.mdx. We would like to have consistent docs,...
Read more >
Icons - Forma 36
Icons are used to indicate actions, statuses and navigation. The icon components can be used in Button , TextLink , Note and other...
Read more >
EntryCard - Forma 36
To show a badge with the status of the entry, you can pass one of "archived", "changed", "deleted", "draft", "new", or "published" to...
Read more >
Adding icons - Forma 36
To add the new icon to Forma 36, you will need to a React component in /packages/components/icons/src using an SVG. These components should...
Read more >
The Contentful Design System - Forma 36
Form is a wrapper component to apply a consistent layout and handle form submissions. Table of contents. How to use Form; Component variations ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found