0.0.23 • Published 3 months ago

@real-system/disclosure v0.0.23

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Installation

# install peer dependencies

# npm
$ npm install react react-dom @real-system/utils-library @real-system/disclosure-primitive @real-system/styled-library @real-system/elements-primitive
# yarn
$ yarn add react react-dom @real-system/utils-library @real-system/disclosure-primitive @real-system/styled-library @real-system/elements-primitive

# install disclosure

# npm
$ npm install @real-system/disclosure
# yarn
$ yarn add @real-system/disclosure

Code Example

import { Disclosure } from '@real-system/disclosure';
import { Icon } from '@real-system/icon';
const DefaultDisclosure = () => {
  return (
    <Disclosure>
      <Disclosure.Toggle>Accordion Item 1</Disclosure.Toggle>
      <Disclosure.Content>Some content to expand and collapse</Disclosure.Content>
    </Disclosure>
  )
}

const ContainedDisclosure = () => {
  return (
    <Disclosure contained>
      <Disclosure.Toggle>Accordion Item 1</Disclosure.Toggle>
      <Disclosure.Content>Some content to expand and collapse</Disclosure.Content>
    </Disclosure>
  )
}

const CustomHeadingDisclosure = () => {
  return (
    <Disclosure contained>
      {({ visible }) => (
        <Disclosure.Trigger hideToggleIcon>
          <Icon icon={visible ? 'arrow-down' : 'arrow-right'} mr={4} />
          <Disclosure.Heading>Accordion Item 1</Disclosure.Heading>
        </Disclosure.Trigger>
        <Disclosure.Content>Some content to expand and collapse</Disclosure.Content>
      )}
    </Disclosure>
  )
}
0.0.23

3 months ago

0.0.22

4 months ago

0.0.21

4 months ago

0.0.20

4 months ago

0.0.17

7 months ago

0.0.18

7 months ago

0.0.19

7 months ago

0.0.12

2 years ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.16

1 year ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago