mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-15 02:33:50 +08:00
[ui][collapsible] add defaultOpen prop (#314)
This commit is contained in:
@ -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 (
|
||||
<Disclosure>
|
||||
<Disclosure defaultOpen={defaultOpen}>
|
||||
{({ open }) => (
|
||||
<>
|
||||
<Disclosure.Button className="text-primary-900 hover:bg-primary-100 focus-visible:ring-primary-500 -mx-2.5 box-content flex w-full justify-between rounded-lg px-2.5 py-2 text-left text-sm font-medium focus:outline-none focus-visible:ring focus-visible:ring-opacity-75">
|
||||
|
Reference in New Issue
Block a user