Adding the possibility to add multiple ui components in the live code editor in the docs (#2381)

* working

* forgot docs folder

* modify according to comments
This commit is contained in:
bosiraphael
2023-11-07 12:33:40 +01:00
committed by GitHub
parent 398a8d732d
commit 7aa6b20418
6 changed files with 72 additions and 31 deletions

View File

@ -6,11 +6,13 @@ sidebar_position: 1
import { SandpackEditor} from '@site/src/ui/SandpackEditor'
<SandpackEditor
componentPath='@/ui/Checkmark/components/Checkmark'
availableComponentPaths={['@/ui/Checkmark/components/Checkmark', '@/ui/Button/components/Button']}
componentCode={`import { Checkmark } from "@/ui/Checkmark/components/Checkmark";
import { Button } from "@/ui/Button/components/Button";
export const MyComponent = () => {
return <Checkmark />;
return <><Checkmark /><Button title="New task"
variant={'secondary'}
onClick={() => console.log('click')}/></>
}
`}
/>