Skip to content

Commit

Permalink
Document latest Portal changes (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitgrelard committed Jun 15, 2022
1 parent dc4e21f commit b71ea01
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions data/primitives/overview/releases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ metaDescription: Radix Primitives releases and their changelogs.
- [**Breaking**] Move `allowPinchZoom` to root <PRLink id={1400} />
- [**Breaking**] Add new `Portal` part. To avoid regressions, use this part if you want portalling behavior. Note that `z-index` isn't managed anymore so you have full control of layering. <PRLink id={1425} />

<PackageRelease name="Portal" version="0.1.5" />

- [**Breaking**] Note that `z-index` isn't managed anymore so you have full control of layering. The prop to provide a custom container evolves from `containerRef` (ref) to `container` (element). The `data-radix-portal` was removed because you can use `asChild` to control the element. <PRLink id={1463} />

<PackageRelease name="RadioGroup" version="0.1.6" />

- Add `aria-required` to root <PRLink id={1422} />
Expand Down
17 changes: 12 additions & 5 deletions data/primitives/utilities/portal/0.1.5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,23 @@ export default () => <Portal.Root>Content</Portal.Root>;

### Root

Anything you put inside this component will be rendered in a separate `<div data-radix-portal>` element. By default, this element will be appended to `document.body` but you can choose a different container by using the `containerRef` prop.
Anything you put inside this component will be rendered in a separate `<div>` element. By default, this element will be appended to `document.body` but you can choose a different container by using the `container` prop.

<PropsTable
data={[
{
name: 'containerRef',
type: 'React.RefObject<HTMLElement>',
typeSimple: 'ref',
name: 'asChild',
required: false,
type: 'boolean',
default: 'false',
description:
'A optional ref to a different container where the portaled content should be appended.',
'Change the component to the HTML tag or custom component of the only child. This will merge the original component props with the props of the supplied element/component and change the underlying DOM node.',
},
{
name: 'container',
type: 'HTMLElement',
description:
'A optional different container where the portaled content should be appended.',
},
]}
/>

0 comments on commit b71ea01

Please sign in to comment.