Skip to content

Collapsible Primitive

A dynamic element that facilitates the expansion or collapse of a panel.

Installation

Install the component via your command line.

Terminal window
npx expo install @rn-primitives/collapsible

Usage

import * as CollapsiblePrimitive from '@rn-primitives/collapsible';
function Example() {
return (
<CollapsiblePrimitive.Root>
<CollapsiblePrimitive.Trigger >
<Text>Toggle</Text>
</CollapsiblePrimitive.Trigger>
<CollapsiblePrimitive.Content >
<Text>@radix-ui/react</Text>
</CollapsiblePrimitive.Content>
</CollapsiblePrimitive.Root>
);
}

Props

Root

Extends View props

PropTypeNote
asChildboolean(optional)
openboolean(optional)
onOpenChange(value: boolean) => void(optional)
defaultOpenboolean(optional)
disabledboolean(optional)

Trigger

Extends Pessable props

PropTypeNote
asChildboolean(optional)

Content

Extends View props

PropTypeNote
asChildboolean(optional)
forceMounttrue | undefined;(optional)