Skip to content

[Feature Request]: As a Developer, I would like to import types from @carbon/react #16436

@digiacomo-a

Description

@digiacomo-a

The problem

Users are often using reusable components to render Tags with different colors (type) based on some status.
To achieve this, a TagType enum needs to be defined because we can not import it from carbon/react.

For instance:

enum TagType {
        red = 'red'
        green....
        ... 
}

interface CustomInterface {
  type: TagType,
  title: string,
}

The solution

Could be nice to define and export a TagType containing all supported types and then import it so that we can use it in our interfaces, couple of examples below.

Examples

Example of an interface for Props, with tagType

import {TagType} from '@carbon/react';

interface CustomInterface {
  tagType: TagType,
  title: string,
}

`<MyCustomCardWithTag tagType={TagType.red} title="Example" />`

Application/PAL

No response

Business priority

Low Priority = release date is not dependent on fix or not upcoming

Available extra resources

I'm happy to contribute if this change can be useful.

Code of Conduct

Metadata

Metadata

Assignees

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions