0.8.1 • Published 1 month ago

@fluentui-react-native/experimental-expander v0.8.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@fluentui-react-native/experimental-expander

This package provides a FluentUI React Native implementation of the WinUI 2.6 Expander control.

This component is only supported on Windows.

Getting started

$ npm install @fluentui-react-native/experimental-expander --save

or

$ yarn add @fluentui-react-native/experimental-expander

After the package has been installed, run the following command to link the package.

npx react-native autolink-windows

Usage

Import Expander from @fluentui-react-native/experimental-expander

import { Expander } from @fluentui-react-native/experimental-expander

Add Expander as follows:

<Expander collapsedHeight={50} expandedHeight={100}>
  <Text>Text in the header</Text>
  <Text>Text in the content</Text>
</Expander>

The first child element of Expander will be assigned to the header, and the second child element will be assigned to the content. If you would like multiple components in the header or the content, wrap them in View as follows:

<Expander collapsedHeight={75} expandedHeight={150}>
  <View>
    <Text>Text in the header</Text>
    <Text>Second line of text in the header<Text>
  </View>
  <View>
    <Text>Text in the content</Text>
    <Text>Second line of text in the content<Text>
  </View>
</Expander>

Props

Tokens

Important notes

  • collapsedHeight and expandedHeight must be set for Expander to display correctly. There is no need to set the height prop.
  • Non-native components within the header will not be interactable (i.e. if there is a Button in the header, and you press it, the Expander will expand, and the Button functionality will not be performed). We recommend using react-native-xaml controls in the header if you would like an interactive control that does not have a native implementation.

Reference

Props

expandDirection

Specifies the direction that the Expander should expand.

  • 'down': Expands downward. This is the default.
  • 'up': Expands upward.
TypeRequired
enum('up', 'down')No

expanded

Specifies if the Expander is expanded. Default is false.

TypeRequired
booleanNo

enabled

If set to false, the Expander will be disabled, i.e. the user will not be able to expand it.

TypeRequired
booleanNo

height

Sets the height of the Expander. In order to maintain expand/collapse functionality, do not set this value. Instead, use collapsedHeight and expandedHeight.

TypeRequired
numberNo

expandedHeight

Sets the height of the Expander while it is expanded.

TypeRequired
numberYes

collapsedHeight

Sets the height of the Expander while it is collapsed.

TypeRequired
numberYes

onCollapsing

Callback for when the Expander begins to collapse.

TypeRequired
functionNo

onExpanding

Callback for when the Expander begins to expand.

TypeRequired
functionNo

Tokens

width

Sets the width of the Expander.

TypeRequired
numberNo

contentHorizontalAlignment

Sets the horizontal alignment of the Expander's content.

  • 'center': The content is aligned in the center of the Expander.
  • 'left': The content is aligned to the left of the Expander.
  • 'right': The content is aligned to the right of the Expander.
  • 'stretch': The content will stretch to fit the Expander.
TypeRequired
enum('center', 'left', 'right', 'stretch')No

contentVerticalAlignment

Sets the vertical alignment of the Expander's content.

  • 'bottom': The content is aligned to the bottom of the Expander.
  • 'center': The content is aligned in the center of the Expander.
  • 'stretch': The content will stretch to fit the Expander.
  • 'top': The content is aligned to the top of the Expander.
TypeRequired
enum('bottom', 'center', 'stretch', 'top')No

headerBackground

Header background color. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

headerForeground

Header foreground color at rest. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

headerForegroundPointerOver

Header foreground color on pointer over. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

headerForegroundPressed

Header foreground color when pressed. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

headerBorderBrush

Header border color at rest. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

headerBorderPointerOverBrush

Header border color on pointer over. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

headerBorderPressedBrush

Header border color when pressed. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

headerDisabledForeground

Header foreground color when disabled. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

headerDisabledBorderBrush

Header border color when disabled. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

headerBorderThickness

Header border thickness.

TypeRequired
numberNo

contentBackground

Content background color. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

contentBorderBrush

Content border color. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

chevronBackground

Chevron background color at rest. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

chevronForeground

Chevron foreground color at rest. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

chevronPointerOverBackground

Chevron background color on pointer over. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

chevronPointerOverForeground

Chevron foreground color on pointer over. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

chevronPressedBackground

Chevron background color when pressed. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

chevronPressedForeground

Chevron foreground color when pressed. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

chevronBorderThickness

Chevron border thickness.

TypeRequired
numberNo

chevronBorderBrush

Chevron border color at rest. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

chevronBorderPointerOverBrush

Chevron border color on pointer over. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo

chevronBorderPressedBrush

Chevron border color when pressed. Input value should be hexadecimal string or a predefined color name string.

TypeRequired
stringNo
0.8.1

1 month ago

0.8.0

1 month ago

0.7.13

2 months ago

0.7.12

2 months ago

0.7.11

2 months ago

0.7.10

2 months ago

0.7.9

3 months ago

0.7.8

3 months ago

0.7.7

4 months ago

0.7.6

5 months ago

0.7.4

5 months ago

0.7.5

5 months ago

0.7.2

5 months ago

0.7.3

5 months ago

0.7.1

5 months ago

0.7.0

6 months ago

0.6.3-testpatch.0

11 months ago

0.6.7

10 months ago

0.6.6

10 months ago

0.6.9

9 months ago

0.6.8

9 months ago

0.6.10

7 months ago

0.6.12

7 months ago

0.6.11

7 months ago

0.6.13

7 months ago

0.6.3

11 months ago

0.6.2

11 months ago

0.6.5

10 months ago

0.6.4

11 months ago

0.6.1

11 months ago

0.6.0

12 months ago

0.5.22

1 year ago

0.5.27

1 year ago

0.5.28

12 months ago

0.5.25

1 year ago

0.5.26

1 year ago

0.5.23

1 year ago

0.5.24

1 year ago

0.5.21

1 year ago

0.5.19

1 year ago

0.5.20

1 year ago

0.5.11

1 year ago

0.5.18

1 year ago

0.5.16

1 year ago

0.5.17

1 year ago

0.5.14

1 year ago

0.5.15

1 year ago

0.5.12

1 year ago

0.5.13

1 year ago

0.5.10

1 year ago

0.4.20

2 years ago

0.4.21

2 years ago

0.5.8

1 year ago

0.5.7

1 year ago

0.5.9

1 year ago

0.4.24

1 year ago

0.4.25

1 year ago

0.4.22

2 years ago

0.4.23

1 year ago

0.4.19

2 years ago

0.4.17

2 years ago

0.4.18

2 years ago

0.4.15

2 years ago

0.4.16

2 years ago

0.4.14

2 years ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.6

1 year ago

0.5.5

1 year ago

0.5.0

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.4.9

2 years ago

0.4.8

2 years ago

0.4.10

2 years ago

0.4.13

2 years ago

0.4.11

2 years ago

0.4.12

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.35

2 years ago

0.3.34

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.31

2 years ago

0.3.30

2 years ago

0.3.33

2 years ago

0.3.32

2 years ago

0.3.29

2 years ago

0.3.28

2 years ago

0.3.27

2 years ago

0.3.26

2 years ago

0.3.25

2 years ago

0.3.24

2 years ago

0.3.23

2 years ago

0.3.22

2 years ago

0.3.21

2 years ago

0.3.20

2 years ago

0.3.19

2 years ago

0.3.18

2 years ago

0.3.9

2 years ago

0.3.17

2 years ago

0.3.16

2 years ago

0.3.15

2 years ago

0.3.14

2 years ago

0.3.13

2 years ago

0.3.12

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.6

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.5

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.2.24

3 years ago

0.2.23

3 years ago

0.2.22

3 years ago

0.3.0

3 years ago

0.2.21

3 years ago

0.2.20

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago