Disclosure

A Disclosure is one collapsible section: a heading that opens and closes the content under it. It is the single-section counterpart to an accordion, for hiding detail that most readers will not need without sending them to another page for it.

Demo

Rendered live, with the same build of the library you install.

Every component in the library, the source, and the right to ship it in anything you like.

Usage

Disclosure.tsx
import { NDisclosure } from '@nayan-ui/react';
const Disclosure = () => {
return (
<div>
<NDisclosure title="What is included?" defaultExpanded>
Every component in the library, the source, and the right to ship it in anything you like.
</NDisclosure>
<NDisclosure title="Do I need a licence key?">No. It is MIT licensed and there is nothing to activate.</NDisclosure>
</div>
);
};
export default Disclosure;

Attributes

10 props
NameTypeDefaultDetails
titleReactNodeRequiredThe title prop.
childrenReactNodeRequiredThe children prop.
defaultExpandedbooleanfalseThe defaultExpanded prop.
expandedbooleanOptionalThe expanded prop.
onExpandedChange(expanded: boolean) => voidOptionalThe onExpandedChange prop.
disabledbooleanfalseThe disabled prop.
classNamestring''The className prop.
triggerClassNamestring''The triggerClassName prop.
contentClassNamestring''The contentClassName prop.
indicatorClassNamestring''The indicatorClassName prop.

Tags

Other components solving nearby problems.