App reviews, troubleshooting, and recommendations
Hi, I am developing Shopify App, I started from Remix template and trying to apply some Design Suggestions from Shopify. I am having problem with Title Bar. I would like to use Title Bar from App Bridge with Breadcrumbs (https://shopify.dev/docs/api/app-bridge-library/reference/title-bar#example-title-bar-with-breadcrum...). The docs is not super helpful with only example:
<ui-title-bar title="Products"> <button variant="breadcrumb">Home</button> </ui-title-bar>
how to make this button "live" and make it working (changing page to home page)?
Sorry if that's stupid question, I am just starting 😅
Hi
Just in case somebody is still looking for the answer to this question.
First the <button> element is a child of the <ui-title-bar> element. So, you need to put <button> inside the <ui-title-bar> element like so:
<ui-title-bar>
<button>Some button</button>
</ui-title-bar>
Second, the <button> child element has attributes in addition to its base attributes. The attributes are:
1- variant: "breadcrumb" or "primary"
2- tone: "critical" or "default"
See these info in https://shopify.dev/docs/api/app-bridge-library/web-components/ui-title-bar and next to "children" click on "UITitleBarChildren"
Now here is the code to make the breadcrumb.
In the child page add:
import { useNavigate } from "@remix-run/react";
export default function childPage() {
const navigate = useNavigate();
return (
<Page>
<ui-title-bar title="Child Page">
<button variant="breadcrumb" onClick={() => navigate("/app")}>
Home
</button>
</ui-title-bar>
<Layout>
<Layout.Section>
...... etc.
the "/app" will take you to the homepage of your app..
Happy developing 🙂
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024