Default Image

Collapse

A content area which can be collapsed and expanded.

import { Collapse } from '@redshank/native';

Examples

Default

Default collapse view.

Without Accordion

Without accordion in collapse.

Without Accordion

Without accordion in collapse.

With SubTitle

With subtitle in panel header.

Nested Collapse

Nested collapse.

Custom Icon

Custom icon in panel.

Borderless

Borderless variant.

Show arrow

Show icon arrow.

Open Keys

Set open keys for total control.

Disable Panels

Disable panels for not extend content.

APIs

Collapse

Api props extends from View

AttributeTypeAccepted valuesDescriptionDefault
accordionbooleantrue falseShow accordion effecttrue
borderColorThemeColorThemeColorBorder color of the elementsaccents7
borderlessbooleantrue falseShow or hidden borderstrue
childrenReactNodeReactNodeAccessory as a child for the component-
contentColorThemeColorThemeColorPanel color of the elementscard
defaultOpenKeysKeyType[]KeyTypeDefault keys for open panels-
headerColorThemeColorThemeColorHeader color of the elementscard
iconReactNodeReactNodeCustom icon arrow<Icon type="antdesign" name="right" color="text" />
iconPositionIconPositionright leftPosition of the arrow iconright
onChangefunction(key: KeyType) => voidFunction trigger when open or close panel-
openKeysKeyType[]KeyTypeOpen keys for open panels-
showArrowbooleantrue falseShow or hidden arrow icontrue
styleStyleProp<ViewStyle>objectStyle object for base elementtrue

Panel

Api props extends from Ripple

AttributeTypeAccepted valuesDescriptionDefault
childrenReactNodeReactNodeAccessory as a child for the component-
disabledbooleantrue falseDisabled panelfalse
idKeyType[]KeyTypeKey panel identify, util with openKeys or defaultOpenKeys-
styleContentStyleProp<ViewStyle>objectStyle object for content body element-
styleHeaderStyleProp<ViewStyle>objectStyle object for header element-
subTitleReactNode stringReactNode textAccessory as a subtitle-
titleReactNode stringReactNode textAccessory as a title-

Key Type

type KeyType = string | number;

Community:

We're excited to see the community adopt @redshank/native, raise issues, and provide feedback. Whether it's a feature request, bug report, or a project to showcase, please get involved!

DiscordGithub

Contributing:

PR's on @redshank/native are always welcome, please see our contribution guidelines to learn how you can contribute to this project.

Copyright © 2023 @redshank.