### React usage example with drizzle-studio element Source: https://github.com/drizzle-team/drizzle-studio-npm/blob/main/_autodocs/api-reference/package-and-imports.md Canonical React integration example from README.md (lines 65–104). Demonstrates the combined import surface, a ref to the element, theme switching via CSS variables, and the element's attributes. The README uses the placeholder package name @drizzle-team/your-company-studio; import from the package name you were issued. ```tsx import type { DrizzleStudioRef } from '@drizzle-team/your-company-studio'; import StudioScript from '@drizzle-team/your-company-studio?raw'; const lightCssVariables = { "--background": "#ffffff", // ...full set of Drizzle Studio CSS variables }; const darkCssVariables = { /* ... */ }; function App() { // create a ref to the drizzle-studio component const studioRef = useRef(null); const [theme, setTheme] = useState<'light' | 'dark'>('light'); return (
); } ``` -------------------------------- ### Element attributes usage example Source: https://github.com/drizzle-team/drizzle-studio-npm/blob/main/_autodocs/api-reference/drizzle-studio-web-component.md Shows the `` element with its attributes as used in the README. The `css-variables` attribute is a JSON-encoded string for theming, `title` sets the title, and `style` uses flexGrow and minHeight to fill space. ```tsx ``` -------------------------------- ### Configure theming with css-variables and title Source: https://github.com/drizzle-team/drizzle-studio-npm/blob/main/_autodocs/configuration.md Defines light and dark CSS variable sets and passes the active one to the element via the css-variables attribute, JSON-encoded with JSON.stringify. The title attribute is set to "Drizzle Studio". The full list of recognized CSS variables is not enumerated in source; only "--background" is shown as an example key. ```tsx const lightCssVariables = { "--background": "#ffffff", // ...additional Drizzle Studio CSS variables }; const darkCssVariables = { /* ... */ }; ``` -------------------------------- ### Basic usage in React Source: https://github.com/drizzle-team/drizzle-studio-npm/blob/main/_autodocs/api-reference/drizzle-studio-web-component.md Canonical React usage from README.md. Imports the ref type and raw script, defines light and dark theme variables, and renders the element with dynamic theme switching via the `css-variables` attribute. ```tsx import { useRef, useState } from 'react'; import type { DrizzleStudioRef } from '@drizzle-team/your-company-studio'; import StudioScript from '@drizzle-team/your-company-studio?raw'; const lightCssVariables = { "--background": "#ffffff", // ... rest of the light theme variables }; const darkCssVariables = { // ... rest of the dark theme variables }; function App() { const studioRef = useRef(null); const [theme, setTheme] = useState<'light' | 'dark'>('light'); return (
); } ``` -------------------------------- ### Import DrizzleStudioRef and StudioScript with ?raw Source: https://github.com/drizzle-team/drizzle-studio-npm/blob/main/_autodocs/api-reference/package-and-imports.md The only module-level imports documented in the README's Integration section. The README uses the placeholder package name @drizzle-team/your-company-studio; the actual published package name is @drizzle-team/studio. The ?raw suffix imports the pre-bundled component script as a raw string. ```ts import type { DrizzleStudioRef } from '@drizzle-team/your-company-studio'; import StudioScript from '@drizzle-team/your-company-studio?raw'; ``` -------------------------------- ### package.json metadata for @drizzle-team/studio Source: https://github.com/drizzle-team/drizzle-studio-npm/blob/main/_autodocs/api-reference/package-and-imports.md Declared verbatim in package.json. Contains only the name and version keys; no other fields such as main, module, exports, types, bin, files, scripts, dependencies, or peerDependencies are present. ```json { "name": "@drizzle-team/studio", "version": "1.0.4" } ``` -------------------------------- ### Embed Drizzle Studio with theme toggle in React Source: https://github.com/drizzle-team/drizzle-studio-npm/blob/main/README.md Embed the Drizzle Studio web component in a React app. Import the component type and raw script from the private npm package, then render the element with a title, CSS variables for theming, and a button to toggle between light and dark themes. The component requires a ref of type DrizzleStudioRef and must be wrapped in a container with a defined height and width. ```tsx import type { DrizzleStudioRef } from '@drizzle-team/your-company-studio'; import StudioScript from '@drizzle-team/your-company-studio?raw'; const lightCssVariables = { "--background": "#ffffff", ... }; const darkCssVariables = { ... }; function App() { // create a ref to the drizzle-studio component const studioRef = useRef(null); const [theme, setTheme] = useState<'light' | 'dark'>('light'); return (
) } export default App ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.