--- title: Migrate Disclosure to the Polaris details component description: >- Learn how to migrate the Disclosure component to Polaris web components in checkout and customer account UI extensions. source_url: html: >- https://shopify.dev/docs/apps/build/checkout/migrate-to-web-components/disclosure md: >- https://shopify.dev/docs/apps/build/checkout/migrate-to-web-components/disclosure.md --- # Migrate Disclosure to the Polaris details component The Polaris details component provides expandable and collapsible content sections. It replaces the previous [`Disclosure`](https://shopify.dev/docs/api/checkout-ui-extensions/2025-07/ui-components/interactive/disclosure) component and is available as [``](https://shopify.dev/docs/api/checkout-ui-extensions/latest/web-components/typography-and-content/details) in API versions 2025-10 and newer. The previous `Disclosure` component paired an activator child (a `Button`, `Pressable`, `Checkbox`, or `Switch` with `toggles`) with content children that expanded or collapsed. The Polaris `` component is a single element that renders both summary and content through its own children. *** ## Updated patterns ### Basic disclosure The previous pattern of using `Disclosure` as a wrapper with a `Button toggles` activator is now handled by an `` with `command="--toggle"` and `commandFor` pointing at an `` element by `id`. The button keeps the same visual treatment as before, while `` carries the disclosed content. ## Migrating basic disclosure to s-details ##### Latest (Preact) ```tsx import '@shopify/ui-extensions/preact'; import {render} from 'preact'; export default function extension() { render(, document.body); } function Extension() { return ( <> Show order details Your order includes free shipping and gift wrapping. ); } ``` ##### Pre-Polaris (2025-07) ```tsx import { reactExtension, Button, Disclosure, Text, View, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => , ); function Extension() { return ( Your order includes free shipping and gift wrapping. ); } ``` If you'd prefer the native disclosure widget over a button activator, `` also supports an `` child that renders an inline expandable summary. ### Separate activator with command If you need a trigger element that is separate from the content (for example, a `Checkbox` or `Switch` toggling a content block), use [`command`](https://shopify.dev/docs/api/checkout-ui-extensions/latest/web-components/actions/button#properties-propertydetail-command) and [`commandFor`](https://shopify.dev/docs/api/checkout-ui-extensions/latest/web-components/actions/button#properties-propertydetail-commandfor) on the activator, pointing at the `` by `id`. ## Migrating separate activator pattern ##### Latest (Preact) ```tsx import '@shopify/ui-extensions/preact'; import {render} from 'preact'; export default function extension() { render(, document.body); } function Extension() { return ( <> We'll wrap your order in premium gift paper with a handwritten note. ); } ``` ##### Pre-Polaris (2025-07) ```tsx import { reactExtension, Disclosure, Switch, Text, View, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => , ); function Extension() { return ( Add gift wrapping We'll wrap your order in premium gift paper with a handwritten note. ); } ``` *** ## Updated properties The following properties are different in the Polaris details component. ### default​Open The previous `Disclosure` `defaultOpen` prop accepted `boolean`, `string`, or `string[]` values to control which content blocks start expanded. The Polaris [`defaultOpen`](https://shopify.dev/docs/api/checkout-ui-extensions/latest/web-components/typography-and-content/details#properties-propertydetail-defaultopen) prop is a simple `boolean`. | Previous value | New value | Migration notes | | - | - | - | | `{true}` | `defaultOpen` | No change for simple boolean usage. | | `"section-id"` | `defaultOpen` | Use one `` per section and set `defaultOpen` on each one that should start expanded. | | `{["id-1", "id-2"]}` | `defaultOpen` on each `` | Multiple open sections require separate `` elements. | ### transition The previous `Disclosure` `transition` prop is now called [`toggleTransition`](https://shopify.dev/docs/api/checkout-ui-extensions/latest/web-components/typography-and-content/details#properties-propertydetail-toggletransition). | Previous value | New value | Migration notes | | - | - | - | | `'none'` | `toggleTransition="none"` | Disables the transition animation. | | Not set | `toggleTransition="auto"` | `'auto'` is the default. | ### open and on​Toggle The previous controlled pattern using `open` and `onToggle` is now handled through the [`open`](https://shopify.dev/docs/api/checkout-ui-extensions/latest/web-components/typography-and-content/details#properties-propertydetail-open) property and the [`toggle`](https://shopify.dev/docs/api/checkout-ui-extensions/latest/web-components/typography-and-content/details#events-propertydetail-toggle) / [`aftertoggle`](https://shopify.dev/docs/api/checkout-ui-extensions/latest/web-components/typography-and-content/details#events-propertydetail-aftertoggle) events. | Previous pattern | New pattern | Migration notes | | - | - | - | | `open={state}` + `onToggle` | `.open` property + `onToggle` / `onAfterToggle` events | `open` is a JS property that does not reflect to an attribute. | ## Migrating controlled disclosure ##### Latest (Preact) ```tsx import '@shopify/ui-extensions/preact'; import {render} from 'preact'; import {useState} from 'preact/hooks'; export default function extension() { render(, document.body); } function Extension() { const [open, setOpen] = useState(false); return ( <> setOpen(!open)} variant="primary"> {open ? 'Hide' : 'Show'} details setOpen(event.newState === 'open')}> Your order includes free shipping. ); } ``` ##### Pre-Polaris (2025-07) ```tsx import {useState} from 'react'; import { reactExtension, Button, Disclosure, Text, View, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => , ); function Extension() { const [open, setOpen] = useState(false); return ( setOpen(openIds.length > 0)}> Your order includes free shipping. ); } ``` *** ## Removed properties The following properties from the previous `Disclosure` component are no longer needed: * `toggles` on activator children — replaced by `command` and `commandFor` attributes on the activator element, or by using `` inside ``. See the [separate activator pattern](#separate-activator-with-command) above. *** ## New properties The Polaris details component introduces the following new properties: | New prop | Type | Description | | - | - | - | | [`toggleTransition`](https://shopify.dev/docs/api/checkout-ui-extensions/latest/web-components/typography-and-content/details#properties-propertydetail-toggletransition) | `'auto'` \| `'none'` | Controls the expand/collapse animation. Default is `'auto'`. Replaces the previous `transition` prop. | ***