Skip to main content

Bookend

Bookend sets the leading and/or trailing child to its inherent size while the remaining children fill the available space


bookend
import {extend, Bookend, TextField, Button} from '@shopify/post-purchase-ui-extensions';

extend('Checkout::PostPurchase::Render', (root) => {
const bookend = root.createComponent(Bookend, {trailing: true}, [
root.createComponent(TextField, {label: 'Discount'}),
root.createComponent(Button, {plain: true}, 'Apply'),
]);

root.appendChild(bookend);
});
import {render, Bookend, TextField, Button} from '@shopify/post-purchase-ui-extensions-react';

render('Checkout::PostPurchase::Render', () => <App />);

function App() {
return (
<Bookend trailing>
<TextField label="Discount" />
<Button plain>Apply</Button>
</Bookend>
);
}

optional = ?

NameTypeDescription
leading?booleanSets the leading child to its inherent size
trailing?booleanSets the trailing child to its inherent size
alignment?"leading" | "center" | "trailing"Position children along the cross axis
spacing?"xtight" | "tight" | "loose" | "xloose"Adjust spacing between children

Was this page helpful?