Patternfly-react: Feature: Support JSX.Element on Tab title property

Created on 1 Aug 2019  路  8Comments  路  Source: patternfly/patternfly-react

Right now, Tab title component only supports string values. It would be great that it supported Elements.

Kiali wants to render as a tab title one string and one icon, like the following:
Screenshot of Kiali Console (4)
Screenshot of Kiali Console (5)

This is blocking our progress into migration to PF4.

PF4 enhancement p2

Most helpful comment

I can confirm that this has been fixed and is not a blocked in Kiali's side. Thanks.

All 8 comments

cc @serenamarie125 @aljesusg @pilhuhn @abonas

In the second example, we needed to have this last tab opening a new tab (other tabs should just run as usual). Is there a way to achieve it with actual implementation of tabs?

Hi @xeviknal what is your timeline like on this request, and what level of urgency would you say this is?

@rachael-phillips another workaround for both solutions: icons and links.
However, starting to have a lot of workarounds, hehe.

Example that works. Notice the trick of telling title is type any. Tab.title expects a string.

const title: any = (
          <>
            Traces <Icon type={'fa'} name={'external-link'} />
          </>
        );
<Tab eventKey={3} title={title} />

Non working scenario:

      <Tab eventKey={3}
            title={
              <>
              'Traces ' + <Icon type={'fa'} name={'external-link'} />
              </>
            }
          />

That's a great point, @xeviknal Thanks for posting the workaround! @tlabaj I am adding this as a P2 - please feel free to update

@rachael-phillips @tlabaj can you assign this to me?

Done! Thanks for your help @boaz0 !

I can confirm that this has been fixed and is not a blocked in Kiali's side. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

priley86 picture priley86  路  3Comments

crackcomm picture crackcomm  路  4Comments

eyevana picture eyevana  路  7Comments

priley86 picture priley86  路  3Comments

SpyTec picture SpyTec  路  3Comments