From 702811bafa66f500270de90f8ac32f70ed2bf4f6 Mon Sep 17 00:00:00 2001 From: Jeff Sieu Date: Fri, 7 Oct 2022 14:32:03 +0800 Subject: [PATCH] [ui][collapsible] add defaultOpen prop (#314) --- packages/ui/src/Collapsible/Collapsible.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/Collapsible/Collapsible.tsx b/packages/ui/src/Collapsible/Collapsible.tsx index a088fdb6..93e5ba10 100644 --- a/packages/ui/src/Collapsible/Collapsible.tsx +++ b/packages/ui/src/Collapsible/Collapsible.tsx @@ -5,12 +5,13 @@ import { ChevronDownIcon } from '@heroicons/react/20/solid'; type Props = Readonly<{ children: ReactNode; + defaultOpen?: boolean; label: string; }>; -export default function Collapsible({ children, label }: Props) { +export default function Collapsible({ children, defaultOpen, label }: Props) { return ( - + {({ open }) => ( <>