How do I add an Icon Button?

I was looking to add a back button to my app, as seen in Rentbit, but I don’t see Icon Button as an option while building my own app. Is it still available?

I thought Button Text might be a good alternative, but the integration tab for Button Text says, “This component doesn’t support actions, yet!”, so there’s no way to have a navigation action associated with it. This seems odd.

What am I missing?

Thanks!!
Gary

Hi Gary,

You can place a Touchable on your screen and then place an Icon inside of it. You’ll be able to set an action on the Touchable. Let me know if you need more help with this.

You should be able to attach an action to Button Text so we’ll get that fixed as well.

Thanks!
Angela

1 Like

Hey @Gary_Griffin, in addition to the great info that @angela shared, the “best practice” for adding <Back buttons to your app headers is by using Navigation. I believe the Back buttons you mention in Rentbit are enabled by Navigation.

Here are the docs on Navigation: https://docs.draftbit.com/docs/intro-to-navigation

Thank you @angela! I’ll use that approach and perhaps create a custom block combining the two elements for easy reuse. I was just confused upon seeing the Icon Button in the Rentbit UI and imported in the code:

import {
  ...
  IconButton,
  ...
} from '@draftbit/ui';

Yet it was not available here:

Thanks @nickselman! Yes, I am using navigation and was using Rentbit as a guide.