Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

Collapsible

Pass the button content as trigger and the revealed region as children. Use open with onOpenChange to control it.

The default indicator follows state. Pass indicator={false} to hide it or a React node to replace it.

import { Collapsible, Text } from '@manti-ui/react';

export default function CollapsibleBasic() {
  return (
    <div className="w-full max-w-[calc(var(--manti-space-16)*6)]">
      <Collapsible trigger="Show chef's note">
        <Text className="p-3 px-1 pt-3" emphasis="muted">
          Rest the dough for 30 minutes so it rolls out smooth and thin.
        </Text>
      </Collapsible>
    </div>
  );
}

API

PropTypeDefaultDescription
triggerReactNodeThe content of the toggle button.
indicatorReactNode | falseTrailing indicator. Uses the state-aware Manti icon by default; pass false to hide it.
childrenReactNodeThe collapsible content revealed when open.
openbooleanControlled open state.
defaultOpenbooleanInitial open state for uncontrolled usage.
onOpenChange(open: boolean) => voidCalled whenever the open state changes.
disabledbooleanDisable the trigger.

Styling

Anatomy

PartSelectorDescription
root[data-scope="collapsible"][data-part="root"]The wrapper around the trigger and content.
trigger[data-scope="collapsible"][data-part="trigger"]The button that toggles the disclosure.
indicator[data-scope="collapsible"][data-part="indicator"]The paired chevrons that identify the disclosure control.
content[data-scope="collapsible"][data-part="content"]The region that animates its height open and closed.

Tokens

TokenControls
--manti-collapsible-radiusradius
--manti-collapsible-padding-xpadding x
--manti-collapsible-padding-ypadding y
--manti-collapsible-gapgap
--manti-collapsible-icon-sizeicon size

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub