Box

Build vertically collapsing boxes.

Title

Write your own title by using title prop.

<>
	<Box title="Title" name="name" >
		<p>Larry the Bird. Larry Joe Bird (born December 7, 1956) is an
                American former professional basketball player, coach and
                executive in the National Basketball Association (NBA).</p>
	</Box>
</>

State

Make the box expanded on start by adding isOpen prop.

<>
	<Box isOpen title="Title" name="name" >
		<p>Larry the Bird. Larry Joe Bird (born December 7, 1956) is an
                American former professional basketball player, coach and
                executive in the National Basketball Association (NBA).</p>
	</Box>
</>

Collapsible

Make the box collapsible when the content is way too long by adding collapsible prop.

<>
	<Box collapsible title="Title" name="name" >
		<p>Larry the Bird. Larry Joe Bird (born December 7, 1956) is an
                American former professional basketball player, coach and
                executive in the National Basketball Association (NBA).
                Nicknamed 'the Hick from French Lick' and 'Larry Legend,' Bird
                is widely regarded as one of the greatest basketball players of
                all time.Larry the Bird. Larry Joe Bird (born December 7, 1956)
                is an American former professional basketball player, coach and
                executive in the National Basketball Association (NBA).
                Nicknamed 'the Hick from French Lick' and 'Larry Legend,' Bird
                is widely regarded as one of the greatest basketball players of
                all time.Larry the Bird. Larry Joe Bird (born December 7, 1956)
                is an American former professional basketball player, coach and
                executive in the National Basketball Association (NBA).
                Nicknamed 'the Hick from French Lick' and 'Larry Legend,' Bird
                is widely regarded as one of the greatest basketball players of
                all time.</p>
	</Box>
</>

Extra buttons

Add an extra button that shows when the box is expanded by extraButtons prop.

<>
	<Box extraButtons={<Button btnStyle='simple'>Extra button</Button>} title="Title" name="name" >
		<p>Larry the Bird. Larry Joe Bird (born December 7, 1956) is an
                American former professional basketball player, coach and
                executive in the National Basketball Association (NBA).</p>
	</Box>
</>

API

import Box from "erxes-ui/lib/components/Box";
  • required prop
NAMETYPEDEFAULTDESCRIPTION
title*stringstringShows title of the box
namestringstringDefine name
children*React.ReactNodeGives content to box
extraButtonsReact.ReactNodeDisplay an extra button on the box
callbackfunctionDefine additional fuction when title is clicked
collapsiblebooleanfalseMake the box collapsible
isOpenbooleanfalseMake the box expanded on start

Was this page helpful?