Skip to contentSkip to navigationSkip to topbar
Paste assistant Assistant
Figma
Star

Disclosure

Version 12.1.0GithubStorybookPeer review pending

A Disclosure is a collapsible accordion that gives hierarchy to a page.

Installation

Installation page anchor
yarn add @twilio-paste/disclosure - or - yarn add @twilio-paste/core
import {Disclosure, DisclosureHeading, DisclosureContent} from '@twilio-paste/core/disclosure';

const PopoverExample: React.FC = () => {
  return (
    <Disclosure>
      <DisclosureHeading as="h2" variant="heading20">
        Disclosure Heading
      </DisclosureHeading>
      <DisclosureContent>Disclosure content</DisclosureContent>
    </Disclosure>
  );
};

Disclosure

Disclosure page anchor

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
any
Default
'DISCLOSURE'

state

Provide the Disclosure state returned from useDisclosureState if you want to control the state of the Disclosure.

Type
DisclosureStateReturn

variant

Changes the styling on the component based on the variant selected.

Type
DisclosureVariants
Default
'default'

as

Type
any

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
any
Default
'DISCLOSURE_HEADING'

marginBottom

Type
any

variant

Type
any

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
any
Default
'DISCLOSURE_CONTENT'