### Install @sanity/ui and Peer Dependencies Source: https://github.com/sanity-io/ui/blob/main/README.md Install the @sanity/ui package and its required peer dependencies using npm. ```sh npm install @sanity/ui # Install peer dependencies npm install react react-dom styled-components ``` -------------------------------- ### Setup ThemeProvider for Sanity UI Source: https://context7.com/sanity-io/ui/llms.txt Wrap your application in ThemeProvider and build a theme using buildTheme(). The scheme prop controls the color context. ```tsx import {ThemeProvider, studioTheme} from '@sanity/ui' import {buildTheme} from '@sanity/ui/theme' import {createRoot} from 'react-dom/client' const theme = buildTheme() createRoot(document.getElementById('root')!).render( ) ``` -------------------------------- ### Button Examples with Various Props Source: https://context7.com/sanity-io/ui/llms.txt Demonstrates different configurations of the Button component, including text, icons, loading states, tones, and modes. Ensure necessary imports from '@sanity/ui' and '@sanity/icons'. ```tsx import {Button} from '@sanity/ui' import {AddIcon, TrashIcon} from '@sanity/icons' function ButtonExamples() { const [loading, setLoading] = React.useState(false) const handleSave = async () => { setLoading(true) await saveData() setLoading(false) } return ( {/* Default filled button */} {open &&
Dropdown content
} ) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.